Fix #225 and some other uses of a.IsInWorld / a.IsDead()

This commit is contained in:
Paul Chote
2010-10-08 10:28:09 +13:00
parent ad6481c8e8
commit fd34f2ba99
8 changed files with 20 additions and 9 deletions

View File

@@ -61,9 +61,10 @@ namespace OpenRA.Traits
void DrawHealthBar(Actor self, float2 xy, float2 Xy)
{
if (!self.IsInWorld) return;
var health = self.TraitOrDefault<Health>();
if (self.IsDead() || health == null)
return;
if (health == null || health.IsDead) return;
var c = Color.Gray;
Game.Renderer.LineRenderer.DrawLine(xy + new float2(0, -2), xy + new float2(0, -4), c, c);