mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
- Attempting to fix a NoSuchElementException in ChangeZoneAllAi when no opponent can be legally targeted with an ability.
This commit is contained in:
@@ -155,6 +155,10 @@ public class ChangeZoneAllAi extends SpellAbilityAi {
|
|||||||
final Iterable<Player> oppList = Iterables.filter(ai.getOpponents(),
|
final Iterable<Player> oppList = Iterables.filter(ai.getOpponents(),
|
||||||
PlayerPredicates.isTargetableBy(sa));
|
PlayerPredicates.isTargetableBy(sa));
|
||||||
|
|
||||||
|
if (Iterables.isEmpty(oppList)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// get the one with the most in graveyard
|
// get the one with the most in graveyard
|
||||||
// zone is visible so evaluate which would be hurt the most
|
// zone is visible so evaluate which would be hurt the most
|
||||||
Player oppTarget = Collections.max(Lists.newArrayList(oppList),
|
Player oppTarget = Collections.max(Lists.newArrayList(oppList),
|
||||||
|
|||||||
Reference in New Issue
Block a user