Merge branch 'master' into 'master'

Fixed the AI not putting the Najeela trigger on stack if it doesn't want to use it.

See merge request core-developers/forge!925
This commit is contained in:
Michael Kamensky
2018-09-16 16:04:39 +00:00

View File

@@ -311,6 +311,12 @@ public class TokenAi extends SpellAbilityAi {
}
}
if (mandatory) {
// Necessary because the AI goes into this method twice, first to set up targets (with mandatory=true)
// and then the second time to confirm the trigger (where mandatory may be set to false).
return true;
}
if ("OnlyOnAlliedAttack".equals(sa.getParam("AILogic"))) {
Combat combat = ai.getGame().getCombat();
return combat != null && combat.getAttackingPlayer() != null