From d17b3d4019ba111c49ade957c124b7ddfd4d5f61 Mon Sep 17 00:00:00 2001 From: Agetian Date: Fri, 7 Jul 2017 18:16:20 +0000 Subject: [PATCH] - Attempting to improve CountersPutAi when targeting the AI player itself (shouldn't try it if the AI player has no counters at all) -TODO: isn't the inner condition check somewhat off too? (will currently attempt targeting every time eachExisting is false, even if the AI has no counters at all). --- .../src/main/java/forge/ai/ability/CountersPutAi.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/forge-ai/src/main/java/forge/ai/ability/CountersPutAi.java b/forge-ai/src/main/java/forge/ai/ability/CountersPutAi.java index c503b722559..a5e85b3f271 100644 --- a/forge-ai/src/main/java/forge/ai/ability/CountersPutAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/CountersPutAi.java @@ -199,9 +199,11 @@ public class CountersPutAi extends SpellAbilityAi { if (sa.canTarget(ai)) { // don't target itself when its forced to add poison // counters too - if (!eachExisting || ai.getPoisonCounters() < 5) { - sa.getTargets().add(ai); - return true; + if (!ai.getCounters().isEmpty()) { + if (!eachExisting || ai.getPoisonCounters() < 5) { + sa.getTargets().add(ai); + return true; + } } }