From 96728262e6dd985ae374d4548a7443ab488577ad Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Tue, 22 Dec 2009 23:05:49 +1300 Subject: [PATCH] fix dumb building/tree placement stuff --- OpenRa.Game/Traits/Building.cs | 13 +++---------- trees.ini | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 20 deletions(-) diff --git a/OpenRa.Game/Traits/Building.cs b/OpenRa.Game/Traits/Building.cs index df080e2188..63a1eda894 100644 --- a/OpenRa.Game/Traits/Building.cs +++ b/OpenRa.Game/Traits/Building.cs @@ -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) diff --git a/trees.ini b/trees.ini index 437e0b7614..9ee1c6dd47 100644 --- a/trees.ini +++ b/trees.ini @@ -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