fix dumb building/tree placement stuff

This commit is contained in:
Chris Forbes
2009-12-22 23:05:49 +13:00
parent 91a04dc96a
commit 96728262e6
2 changed files with 13 additions and 20 deletions

View File

@@ -2,22 +2,15 @@
namespace OpenRa.Game.Traits
{
class Building : ITick, INotifyDamage
class Building : INotifyDamage
{
public readonly BuildingInfo unitInfo;
public Building(Actor self)
{
unitInfo = (BuildingInfo)self.Info;
}
bool first = true;
public void Tick(Actor self)
{
if (first)
self.CenterLocation = Game.CellSize * (float2)self.Location + 0.5f * self.SelectedSize;
first = false;
self.CenterLocation = Game.CellSize
* ((float2)self.Location + .5f * (float2)unitInfo.Dimensions);
}
public void Damaged(Actor self, AttackInfo e)

View File

@@ -144,40 +144,40 @@ Selectable=no
[TC01]
Description=Tree
Traits=Building, RenderBuilding
Footprint=xx xx
Dimensions=2,2
Footprint=xx_ xx_
Dimensions=3,2
Name=TC01
Selectable=no
[TC02]
Description=Tree
Traits=Building, RenderBuilding
Footprint=xx xx
Dimensions=2,2
Footprint=xx_ xx_
Dimensions=3,2
Name=TC02
Selectable=no
[TC03]
Description=Tree
Traits=Building, RenderBuilding
Footprint=xx xx
Dimensions=2,2
Footprint=xx_ xx_
Dimensions=3,2
Name=TC03
Selectable=no
[TC04]
Description=Tree
Traits=Building, RenderBuilding
Footprint=xxx xxx xxx
Dimensions=3,3
Footprint=xxx_ xxx_ xxx_
Dimensions=4,3
Name=TC04
Selectable=no
[TC05]
Description=Tree
Traits=Building, RenderBuilding
Footprint=xxx xxx xxx
Dimensions=3,3
Footprint=xxx_ xxx_ xxx_
Dimensions=4,3
Name=TC05
Selectable=no