Fix simulated AI finding wrong card in hand when simulating and add a test.

This commit is contained in:
Myrd
2015-02-08 20:21:23 +00:00
parent 2dc5d6da09
commit 1963cc94ad
2 changed files with 28 additions and 3 deletions

View File

@@ -112,7 +112,7 @@ public class GameSimulator {
Card origHostCard = sa.getHostCard();
ZoneType zone = origHostCard.getZone().getZoneType();
for (Card c : simGame.getCardsIn(zone)) {
if (!c.getOwner().getController().isAI()) {
if (c.getController() != aiPlayer) {
continue;
}
if (c.getName().equals(origHostCard.getName())) {
@@ -137,6 +137,7 @@ public class GameSimulator {
return Integer.MIN_VALUE;
}
System.out.println("Found SA " + sa + " on host card " + sa.getHostCard() + " with owner:"+ sa.getHostCard().getOwner());
sa.setActivatingPlayer(aiPlayer);
if (origSa.usesTargeting()) {
for (GameObject o : origSa.getTargets().getTargets()) {