diff --git a/OpenRa.Game/Actor.cs b/OpenRa.Game/Actor.cs index d6be741ade..86c3e095f9 100755 --- a/OpenRa.Game/Actor.cs +++ b/OpenRa.Game/Actor.cs @@ -79,6 +79,8 @@ namespace OpenRa.Game } } + public bool IsDead { get { return Health <= 0; } } + public void InflictDamage(Actor attacker, Bullet inflictor, int damage) { /* todo: auto-retaliate, etc */ diff --git a/OpenRa.Game/Traits/AttackTurreted.cs b/OpenRa.Game/Traits/AttackTurreted.cs index 3543fbf4e7..ac31c6e3a9 100755 --- a/OpenRa.Game/Traits/AttackTurreted.cs +++ b/OpenRa.Game/Traits/AttackTurreted.cs @@ -28,6 +28,12 @@ namespace OpenRa.Game.Traits if( target == null ) return; + if (target.IsDead) /* stop firing on targets after we've killed them */ + { + target = null; + return; + } + var turreted = self.traits.Get(); turreted.desiredFacing = Util.GetFacing( target.CenterLocation - self.CenterLocation, turreted.turretFacing ); if( turreted.desiredFacing != turreted.turretFacing )