From c47da9acdd4ce15450c631f85738e9f46ca90d46 Mon Sep 17 00:00:00 2001 From: Hanmac Date: Fri, 20 Apr 2018 13:01:29 +0200 Subject: [PATCH] PlayEffect: don't cast to CardCollection --- .../java/forge/game/ability/effects/PlayEffect.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/forge-game/src/main/java/forge/game/ability/effects/PlayEffect.java b/forge-game/src/main/java/forge/game/ability/effects/PlayEffect.java index 4c85f728010..2208dea8157 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/PlayEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/PlayEffect.java @@ -78,7 +78,9 @@ public class PlayEffect extends SpellAbilityEffect { if (sa.hasParam("ValidZone")) { zone = ZoneType.smartValueOf(sa.getParam("ValidZone")); } - tgtCards = (CardCollection)AbilityUtils.filterListByType(game.getCardsIn(zone), sa.getParam("Valid"), sa); + tgtCards = new CardCollection( + AbilityUtils.filterListByType(game.getCardsIn(zone), sa.getParam("Valid"), sa) + ); } else if (sa.hasParam("AnySupportedCard")) { List cards = Lists.newArrayList(StaticData.instance().getCommonCards().getUniqueCards()); @@ -110,7 +112,11 @@ public class PlayEffect extends SpellAbilityEffect { } if (sa.hasParam("ChoiceNum")) { final int choicenum = AbilityUtils.calculateAmount(source, sa.getParam("ChoiceNum"), sa); - tgtCards = (CardCollection)activator.getController().chooseCardsForEffect(choice, sa, source + " - Choose up to " + Lang.nounWithNumeral(choicenum, "card"), 0, choicenum, true); + tgtCards = new CardCollection( + activator.getController().chooseCardsForEffect(choice, sa, + source + " - Choose up to " + Lang.nounWithNumeral(choicenum, "card"), 0, choicenum, true + ) + ); } else { tgtCards = choice;