From 423599eaa39302a4a38a3ffc6bfa404f2a5c56cc Mon Sep 17 00:00:00 2001 From: Agetian Date: Sun, 19 Feb 2017 04:27:45 +0000 Subject: [PATCH] - For cards like Restore Balance, Balance, etc., and for other cases where the AI uses getWorstLand/getWorstLandToAnimate, ensure that lands with negative initial score are still considered and picked by the AI (otherwise they're never picked even if the pick is mandatory). --- forge-ai/src/main/java/forge/ai/ComputerUtilCard.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/forge-ai/src/main/java/forge/ai/ComputerUtilCard.java b/forge-ai/src/main/java/forge/ai/ComputerUtilCard.java index 59533f0bad8..b9f875e786a 100644 --- a/forge-ai/src/main/java/forge/ai/ComputerUtilCard.java +++ b/forge-ai/src/main/java/forge/ai/ComputerUtilCard.java @@ -703,7 +703,7 @@ public class ComputerUtilCard { */ public static Card getWorstLand(final List lands) { Card worstLand = null; - int maxScore = 0; + int maxScore = Integer.MIN_VALUE; // first, check for tapped, basic lands for (Card tmp : lands) { int score = tmp.isTapped() ? 2 : 0; @@ -726,7 +726,7 @@ public class ComputerUtilCard { public static Card getBestLandToAnimate(final Iterable lands) { Card land = null; - int maxScore = 0; + int maxScore = Integer.MIN_VALUE; // first, check for tapped, basic lands for (Card tmp : lands) { // TODO Improve this by choosing basic lands that I have plenty of mana in