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)