more. doesn't run. may not compile

This commit is contained in:
Bob
2010-08-20 09:02:18 +12:00
committed by Chris Forbes
parent 5561ac458b
commit 739c38d3d8
4 changed files with 33 additions and 22 deletions

View File

@@ -88,20 +88,6 @@ namespace OpenRA.Traits
damage = (int)(damage * modifier);
hp -= damage;
if (hp <= 0)
{
hp = 0;
attacker.Owner.Kills++;
self.Owner.Deaths++;
if (RemoveOnDeath)
self.World.AddFrameEndTask(w => w.Remove(self));
Log.Write("debug", "{0} #{1} killed by {2} #{3}", self.Info.Name, self.ActorID, attacker.Info.Name, attacker.ActorID);
}
if (hp > MaxHP) hp = MaxHP;
foreach (var nd in self.TraitsImplementing<INotifyDamage>())
nd.Damaged(self, new AttackInfo
@@ -113,6 +99,21 @@ namespace OpenRA.Traits
DamageStateChanged = this.DamageState != oldState,
Warhead = warhead
});
if (hp <= 0)
{
hp = 0;
attacker.Owner.Kills++;
self.Owner.Deaths++;
if( RemoveOnDeath )
self.Destroy();
Log.Write("debug", "{0} #{1} killed by {2} #{3}", self.Info.Name, self.ActorID, attacker.Info.Name, attacker.ActorID);
}
if (hp > MaxHP) hp = MaxHP;
}
}