prevent AI to try to attack its allies, fix #2393

This was SVN commit r14721.
This commit is contained in:
mimo 2014-02-01 17:59:29 +00:00
parent e21f052803
commit 5b506ceee3

View File

@ -80,6 +80,9 @@ m.Defence.prototype.checkEnemyUnits = function(gameState)
i++;
else if (i === PlayerID)
i = 1;
if (gameState.isPlayerAlly(i))
return;
var filter = API3.Filters.and(API3.Filters.byClass("Unit"), API3.Filters.byOwner(i));
var enemyUnits = gameState.updatingGlobalCollection("player-" +i + "-units", filter);