mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
* AI Player - Fixed a bug that AI did not care about existing filter criterias for choosing cards from own hand.
This commit is contained in:
parent
588da451e5
commit
8087a07a9c
1 changed files with 6 additions and 1 deletions
|
@ -224,7 +224,12 @@ public class ComputerPlayer<T extends ComputerPlayer<T>> extends PlayerImpl<T> i
|
|||
}
|
||||
if (target instanceof TargetCardInHand) {
|
||||
List<Card> cards = new ArrayList<>();
|
||||
cards.addAll(this.hand.getCards(game));
|
||||
for (UUID cardId: ((TargetCardInHand)target).possibleTargets(this.getId(), hand, game)) {
|
||||
Card card = game.getCard(cardId);
|
||||
if (card != null) {
|
||||
cards.add(card);
|
||||
}
|
||||
}
|
||||
while(!target.isChosen() && !cards.isEmpty()) {
|
||||
Card pick = pickTarget(cards, outcome, target, null, game);
|
||||
if (pick != null) {
|
||||
|
|
Loading…
Reference in a new issue