mirror of
https://github.com/correl/mage.git
synced 2024-11-14 19:19:32 +00:00
* AI: fixed rollback error while computer try to play some cards with targets from exile;
This commit is contained in:
parent
572b4cf025
commit
1f99249d10
1 changed files with 16 additions and 0 deletions
|
@ -425,6 +425,22 @@ public class ComputerPlayer extends PlayerImpl implements Player {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (target.getOriginalTarget() instanceof TargetCardInExile) {
|
||||
List<UUID> alreadyTargeted = target.getTargets();
|
||||
TargetCard originalTarget = (TargetCard) target.getOriginalTarget();
|
||||
List<Card> cards = game.getExile().getCards(originalTarget.getFilter(), game);
|
||||
while (!cards.isEmpty()) {
|
||||
Card card = pickTarget(abilityControllerId, cards, outcome, target, null, game);
|
||||
if (card != null && alreadyTargeted != null && !alreadyTargeted.contains(card.getId())) {
|
||||
target.add(card.getId(), game);
|
||||
if (target.isChosen()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if (target.getOriginalTarget() instanceof TargetSource) {
|
||||
Set<UUID> targets;
|
||||
targets = target.possibleTargets(sourceId, abilityControllerId, game);
|
||||
|
|
Loading…
Reference in a new issue