* Jace's Archivist - fixed AI freeze the game (#5023);

This commit is contained in:
Oleg Agafonov 2019-04-01 21:52:11 +04:00
parent 97712971fa
commit ef4c223bcf
2 changed files with 18 additions and 14 deletions

View file

@ -10,6 +10,7 @@ import mage.abilities.costs.mana.ColoredManaCost;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.Cards;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.ColoredManaSymbol;
@ -66,13 +67,13 @@ class JacesArchivistEffect extends OneShotEffect {
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
Player player = game.getPlayer(playerId);
if (player != null) {
int discarded = player.getHand().size();
player.discard(discarded, false, source, game);
if (discarded > maxDiscarded) {
maxDiscarded = discarded;
Cards discardedCards = player.discard(player.getHand().size(), false, source, game);
if (discardedCards.size() > maxDiscarded) {
maxDiscarded = discardedCards.size();
}
}
}
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
Player player = game.getPlayer(playerId);
if (player != null) {