From 11fb2412cb7112ec16eeee43f3d9dd92b4359925 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Fri, 27 Feb 2015 15:18:38 +0100 Subject: [PATCH] Fixed a bug of AI target selection that caused endless loops during build of test project. --- .../src/main/java/mage/player/ai/ComputerPlayer.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java b/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java index a05390f98a..cb9a85dda2 100644 --- a/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java +++ b/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java @@ -77,6 +77,7 @@ import java.util.*; import java.util.Map.Entry; import mage.filter.Filter; import mage.filter.predicate.other.PlayerIdPredicate; +import mage.filter.predicate.permanent.ControllerIdPredicate; /** @@ -1954,7 +1955,7 @@ public class ComputerPlayer extends PlayerImpl implements Player { threats = game.getBattlefield().getActivePermanents(filter, this.getId(), sourceId, game); // all permanents within the range of the player } else { FilterPermanent filterCopy = filter.copy(); - filterCopy.add(new PlayerIdPredicate(playerId)); + filterCopy.add(new ControllerIdPredicate(playerId)); threats = game.getBattlefield().getActivePermanents(filter, this.getId(), sourceId, game); } Iterator it = threats.iterator();