- Attempting to fix a NoSuchElementException in ChangeZoneAllAi when no opponent can be legally targeted with an ability.

This commit is contained in:
Agetian
2017-06-28 03:03:01 +00:00
parent dd27db3caf
commit a820bf1c4a

View File

@@ -155,6 +155,10 @@ public class ChangeZoneAllAi extends SpellAbilityAi {
final Iterable<Player> oppList = Iterables.filter(ai.getOpponents(),
PlayerPredicates.isTargetableBy(sa));
if (Iterables.isEmpty(oppList)) {
return false;
}
// get the one with the most in graveyard
// zone is visible so evaluate which would be hurt the most
Player oppTarget = Collections.max(Lists.newArrayList(oppList),