From 84aaccc3da535ec72a49e14b439c3f5a40851a02 Mon Sep 17 00:00:00 2001 From: Hans Mackowiak Date: Sat, 13 Mar 2021 21:39:35 +0100 Subject: [PATCH] CountersPutEffect: fixes ChoiceAmount when it can be Zero --- .../forge/game/ability/effects/CountersPutEffect.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/forge-game/src/main/java/forge/game/ability/effects/CountersPutEffect.java b/forge-game/src/main/java/forge/game/ability/effects/CountersPutEffect.java index 1dad1191eef..d050796c13f 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/CountersPutEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/CountersPutEffect.java @@ -162,14 +162,17 @@ public class CountersPutEffect extends SpellAbilityEffect { chooser = choosers.get(0); } - CardCollection choices = new CardCollection(game.getCardsIn(choiceZone)); - int n = AbilityUtils.calculateAmount(sa.getHostCard(), sa.getParamOrDefault("ChoiceAmount", "1"), sa); int m = AbilityUtils.calculateAmount(sa.getHostCard(), sa.getParamOrDefault("MinChoiceAmount", sa.getParamOrDefault("ChoiceAmount", "1")), sa); - choices = CardLists.getValidCards(choices, sa.getParam("Choices"), activator, card, sa); + // no choices allowed + if (n <= 0) { + return; + } + + CardCollection choices = CardLists.getValidCards(game.getCardsIn(choiceZone), sa.getParam("Choices"), activator, card, sa); String title = Localizer.getInstance().getMessage("lblChooseaCard") + " "; if (sa.hasParam("ChoiceTitle")) {