Fix the autotarget bug that made turrets uncontrollable in combat

This commit is contained in:
ScottNZ
2013-08-13 01:31:04 +12:00
parent ef968a0caf
commit 115a447b2f
3 changed files with 36 additions and 31 deletions

View File

@@ -164,6 +164,12 @@ namespace OpenRA.Mods.RA
self.QueueActivity(GetAttackActivity(self, target, allowMove));
}
public bool IsReachableTarget(Target target, bool allowMove)
{
return HasAnyValidWeapons(target)
&& (target.IsInRange(self.CenterPosition, GetMaximumRange()) || (self.HasTrait<IMove>() && allowMove));
}
class AttackOrderTargeter : IOrderTargeter
{
readonly bool negativeDamage;