From a0a909d04cdbc4a84dbfa1580b480f12d7170b88 Mon Sep 17 00:00:00 2001 From: Michael Kamensky Date: Wed, 14 Oct 2020 23:18:36 +0300 Subject: [PATCH] - Don't add a null card to target in animateTgtAi --- .../main/java/forge/ai/ability/AnimateAi.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/forge-ai/src/main/java/forge/ai/ability/AnimateAi.java b/forge-ai/src/main/java/forge/ai/ability/AnimateAi.java index cb0c37bf3f4..c1e84bc35fb 100644 --- a/forge-ai/src/main/java/forge/ai/ability/AnimateAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/AnimateAi.java @@ -340,17 +340,19 @@ public class AnimateAi extends SpellAbilityAi { // select the worst of the best final Card worst = ComputerUtilCard.getWorstAI(maxList); - if (worst != null && worst.isLand()) { - // e.g. Clan Guildmage, make sure we're not using the same land we want to animate to activate the ability - this.holdAnimatedTillMain2(ai, worst); - if (!ComputerUtilMana.canPayManaCost(sa, ai, 0)) { - this.releaseHeldTillMain2(ai, worst); - return false; + if (worst != null) { + if (worst.isLand()) { + // e.g. Clan Guildmage, make sure we're not using the same land we want to animate to activate the ability + this.holdAnimatedTillMain2(ai, worst); + if (!ComputerUtilMana.canPayManaCost(sa, ai, 0)) { + this.releaseHeldTillMain2(ai, worst); + return false; + } } + this.rememberAnimatedThisTurn(ai, worst); + sa.getTargets().add(worst); } - this.rememberAnimatedThisTurn(ai, worst); - sa.getTargets().add(worst); - return true; + return true; } // This is reasonable for now. Kamahl, Fist of Krosa and a sorcery or