From 491d7b8dcd662b3fafeb2baebb20b332024013ec Mon Sep 17 00:00:00 2001 From: Agetian Date: Fri, 22 Sep 2017 05:55:17 +0000 Subject: [PATCH] - A little improvement to the previous commit. git-svn-id: http://svn.slightlymagic.net/forge/trunk@35708 269b9781-a132-4a9b-9d4e-f004f1b56b58 --- forge-ai/src/main/java/forge/ai/ComputerUtilCombat.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/forge-ai/src/main/java/forge/ai/ComputerUtilCombat.java b/forge-ai/src/main/java/forge/ai/ComputerUtilCombat.java index 06d71b03..76795ed5 100644 --- a/forge-ai/src/main/java/forge/ai/ComputerUtilCombat.java +++ b/forge-ai/src/main/java/forge/ai/ComputerUtilCombat.java @@ -2533,6 +2533,7 @@ public class ComputerUtilCombat { // (currently looks for the creature with maximum raw power since that's what the AI usually judges by when // deciding whether the creature is worth blocking). // If the creature doesn't change into anything, returns the original creature. + if (attacker == null) { return null; } Card attackerAfterTrigs = attacker; // Test for some special triggers that can change the creature in combat @@ -2547,7 +2548,7 @@ public class ComputerUtilCombat { // while attacking int maxPwr = 0; for (Card c : attacker.getController().getCreaturesInPlay()) { - if (c.getNetPower() > maxPwr) { + if (c.getNetPower() > maxPwr || (c.getNetPower() == maxPwr && ComputerUtilCard.evaluateCreature(c) > ComputerUtilCard.evaluateCreature(attackerAfterTrigs))) { maxPwr = c.getNetPower(); attackerAfterTrigs = c; }