TreeCache dies; trees & MINE have unitinfo

This commit is contained in:
Chris Forbes
2009-12-03 18:59:11 +13:00
parent bbbe23ae90
commit cf54a47b0c
9 changed files with 295 additions and 19 deletions

View File

@@ -26,7 +26,8 @@ namespace OpenRa.Game.Traits
public void BuildingComplete(Actor self)
{
self.Owner.ChangePower(unitInfo.Power);
if (self.Owner != null)
self.Owner.ChangePower(unitInfo.Power);
}
}
}

View File

@@ -66,7 +66,8 @@ namespace OpenRa.Game.Traits
public override IEnumerable<Tuple<Sprite, float2, int>> Render(Actor self)
{
yield return Tuple.New(anim.Image, 24f * (float2)self.Location, self.Owner.Palette);
var pal = self.Owner == null ? 0 : self.Owner.Palette;
yield return Tuple.New(anim.Image, 24f * (float2)self.Location, pal);
}
public virtual void Damaged(Actor self, DamageState state)