Fix attack behaviour of disabled units.

This commit is contained in:
Lars Beckers
2019-03-30 14:46:17 +00:00
committed by reaperrr
parent 1bb319425b
commit e6750bf19c
4 changed files with 21 additions and 7 deletions

View File

@@ -122,12 +122,12 @@ namespace OpenRA.Mods.Common.Traits
return true;
}
public virtual void DoAttack(Actor self, Target target, IEnumerable<Armament> armaments = null)
public virtual void DoAttack(Actor self, Target target)
{
if (armaments == null && !CanAttack(self, target))
if (!CanAttack(self, target))
return;
foreach (var a in armaments ?? Armaments)
foreach (var a in Armaments)
a.CheckFire(self, facing, target);
}
@@ -350,7 +350,7 @@ namespace OpenRA.Mods.Common.Traits
public void AttackTarget(Target target, bool queued, bool allowMove, bool forceAttack = false)
{
if (IsTraitDisabled || IsTraitPaused)
if (IsTraitDisabled)
return;
if (!target.IsValidFor(self))