fix attackable players in unitai, refs #2749

This was SVN commit r16656.
This commit is contained in:
mimo 2015-05-19 20:10:19 +00:00
parent 4947818c52
commit 6dcf636d7c

View File

@ -5583,9 +5583,9 @@ UnitAI.prototype.CanAttack = function(target, forceResponse)
if (cmpCapturable && cmpCapturable.CanCapture(owner) && cmpAttack.GetAttackTypes().indexOf("Capture") != -1)
return true;
if (IsOwnedByEnemyOfPlayer(owner, target) || IsOwnedByNeutralOfPlayer(owner, target))
if (IsOwnedByEnemyOfPlayer(owner, target))
return true;
if (forceResponse && !IsOwnedByPlayer(owner, target))
if (forceResponse && !IsOwnedByAllyOfPlayer(owner, target))
return true;
return false;
};