forked from 0ad/0ad
Fix inconsitency between AttackEntityInZone and ShouldAbandonChase for units in defensive stance. Patch by mimo. Fixes #1866.
This was SVN commit r13502.
This commit is contained in:
parent
2fcd52b657
commit
d5e081d55f
@ -3447,7 +3447,8 @@ UnitAI.prototype.AttackEntityInZone = function(ents, forceResponse)
|
||||
for each (var target in ents)
|
||||
{
|
||||
var type = this.GetBestAttackAgainst(target);
|
||||
if (this.CanAttack(target, forceResponse) && this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, type))
|
||||
if (this.CanAttack(target, forceResponse) && this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, type)
|
||||
&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target)))
|
||||
{
|
||||
this.PushOrderFront("Attack", { "target": target, "force": false, "forceResponse": forceResponse });
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user