added IsDead property; made attack notice when the target is dead
This commit is contained in:
@@ -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 */
|
||||
|
||||
@@ -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>();
|
||||
turreted.desiredFacing = Util.GetFacing( target.CenterLocation - self.CenterLocation, turreted.turretFacing );
|
||||
if( turreted.desiredFacing != turreted.turretFacing )
|
||||
|
||||
Reference in New Issue
Block a user