diff --git a/Mage/src/mage/game/Game.java b/Mage/src/mage/game/Game.java index 062d188bf1..ae695a2489 100644 --- a/Mage/src/mage/game/Game.java +++ b/Mage/src/mage/game/Game.java @@ -157,7 +157,7 @@ public interface Game extends MageItem, Serializable { public void addDelayedTriggeredAbility(DelayedTriggeredAbility delayedAbility); public void applyEffects(); public boolean checkStateAndTriggered(); - public void playPriority(UUID activePlayerId); + public void playPriority(UUID activePlayerId, boolean resuming); public boolean endTurn(UUID playerId); //game transaction methods diff --git a/Mage/src/mage/game/GameImpl.java b/Mage/src/mage/game/GameImpl.java index 0016bbc62d..2c062a7df4 100644 --- a/Mage/src/mage/game/GameImpl.java +++ b/Mage/src/mage/game/GameImpl.java @@ -361,8 +361,8 @@ public abstract class GameImpl> implements Game, Serializa Player player = getPlayer(players.get()); state.resume(); if (!isGameOver()) { - if (simulation) - logger.info("Turn " + Integer.toString(state.getTurnNum())); +// if (simulation) +// logger.info("Turn " + Integer.toString(state.getTurnNum())); fireInformEvent("Turn " + Integer.toString(state.getTurnNum())); if (checkStopOnTurnOption()) return; state.getTurn().resumePlay(this); @@ -573,12 +573,17 @@ public abstract class GameImpl> implements Game, Serializa } @Override - public void playPriority(UUID activePlayerId) { + public void playPriority(UUID activePlayerId, boolean resuming) { int bookmark = 0; try { while (!isPaused() && !isGameOver()) { - state.getPlayers().resetPassed(); - state.getPlayerList().setCurrent(activePlayerId); + if (!resuming) { + state.getPlayers().resetPassed(); + state.getPlayerList().setCurrent(activePlayerId); + } + else { + state.getPlayerList().setCurrent(this.getPriorityPlayerId()); + } Player player; while (!isPaused() && !isGameOver()) { try { @@ -587,11 +592,14 @@ public abstract class GameImpl> implements Game, Serializa player = getPlayer(state.getPlayerList().get()); state.setPriorityPlayerId(player.getId()); while (!player.isPassed() && !player.hasLost() && !player.hasLeft() && !isPaused() && !isGameOver()) { - checkStateAndTriggered(); - if (isPaused() || isGameOver()) return; - // resetPassed should be called if player performs any action - player.priority(this); - if (isPaused() || isGameOver()) return; + if (!resuming) { + checkStateAndTriggered(); + if (isPaused() || isGameOver()) return; + // resetPassed should be called if player performs any action + player.priority(this); + if (isPaused()) return; + } + resuming = false; applyEffects(); } if (isPaused() || isGameOver()) return; diff --git a/Mage/src/mage/game/turn/Phase.java b/Mage/src/mage/game/turn/Phase.java index 6a14c3961e..2e4356ef94 100644 --- a/Mage/src/mage/game/turn/Phase.java +++ b/Mage/src/mage/game/turn/Phase.java @@ -173,7 +173,7 @@ public abstract class Phase> implements Serializable { if (!currentStep.skipStep(game, activePlayerId)) { prePriority(game, activePlayerId); if (!game.isPaused() && !game.isGameOver()) - currentStep.priority(game, activePlayerId); + currentStep.priority(game, activePlayerId, false); if (!game.isPaused() && !game.isGameOver()) postPriority(game, activePlayerId); } @@ -185,7 +185,7 @@ public abstract class Phase> implements Serializable { prePriority(game, activePlayerId); case PRIORITY: if (!game.isPaused() && !game.isGameOver()) - currentStep.priority(game, activePlayerId); + currentStep.priority(game, activePlayerId, true); case POST: if (!game.isPaused() && !game.isGameOver()) postPriority(game, activePlayerId); diff --git a/Mage/src/mage/game/turn/Step.java b/Mage/src/mage/game/turn/Step.java index 9fb4d12455..fd9b876830 100644 --- a/Mage/src/mage/game/turn/Step.java +++ b/Mage/src/mage/game/turn/Step.java @@ -77,10 +77,10 @@ public abstract class Step> implements Serializable { game.fireEvent(new GameEvent(preStepEvent, null, null, activePlayerId)); } - public void priority(Game game, UUID activePlayerId) { + public void priority(Game game, UUID activePlayerId, boolean resuming) { if (hasPriority) { stepPart = StepPart.PRIORITY; - game.playPriority(activePlayerId); + game.playPriority(activePlayerId, resuming); } }