Fixed a bug for AI target handling of TargetCardInHand.

This commit is contained in:
LevelX2 2013-02-14 10:53:42 +01:00
parent b968e2b4c4
commit 58a05970e8

View file

@ -217,11 +217,13 @@ public class ComputerPlayer<T extends ComputerPlayer<T>> extends PlayerImpl<T> i
if (target instanceof TargetCardInHand) { if (target instanceof TargetCardInHand) {
List<Card> cards = new ArrayList<Card>(); List<Card> cards = new ArrayList<Card>();
cards.addAll(this.hand.getCards(game)); cards.addAll(this.hand.getCards(game));
Card pick = pickTarget(cards, outcome, target, null, game); while(!target.isChosen() && !cards.isEmpty()) {
if (pick != null) { Card pick = pickTarget(cards, outcome, target, null, game);
target.add(pick.getId(), game); if (pick != null) {
return true; target.addTarget(pick.getId(), null, game);
}
} }
return target.isChosen();
} }
if (target instanceof TargetCreatureOrPlayer) { if (target instanceof TargetCreatureOrPlayer) {
List<Permanent> targets; List<Permanent> targets;