diff --git a/forge-gui/src/main/java/forge/player/PlayerControllerHuman.java b/forge-gui/src/main/java/forge/player/PlayerControllerHuman.java index d33e1ecc56d..b52149fb9ce 100644 --- a/forge-gui/src/main/java/forge/player/PlayerControllerHuman.java +++ b/forge-gui/src/main/java/forge/player/PlayerControllerHuman.java @@ -1387,12 +1387,17 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont @Override public List chooseModeForAbility(final SpellAbility sa, final int min, final int num, boolean allowRepeat) { - final List choices = CharmEffect.makePossibleOptions(sa); + final List possible = CharmEffect.makePossibleOptions(sa); + HashMap spellViewCache = new HashMap<>(); + for (AbilitySub spellAbility : possible) { + spellViewCache.put(spellAbility.getView(), spellAbility); + } + final List choices = new ArrayList<>(spellViewCache.keySet()); final String modeTitle = TextUtil.concatNoSpace(sa.getActivatingPlayer().toString(), " activated ", sa.getHostCard().toString(), " - Choose a mode"); final List chosen = Lists.newArrayListWithCapacity(num); for (int i = 0; i < num; i++) { - AbilitySub a; + SpellAbilityView a; if (i < min) { a = getGui().one(modeTitle, choices); } else { @@ -1405,7 +1410,7 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont if (!allowRepeat) { choices.remove(a); } - chosen.add(a); + chosen.add(spellViewCache.get(a)); } return chosen; }