loop until nothing added to stack, AP is turn owner

This commit is contained in:
Maxmtg
2014-02-08 20:52:02 +00:00
parent 862d8ed857
commit a7d359fa10

View File

@@ -964,16 +964,21 @@ public class PhaseHandler implements java.io.Serializable {
SpellAbility chosenSa = null; SpellAbility chosenSa = null;
do { do {
boolean addedAnythingToStack;
do {
addedAnythingToStack = false;
// Rule 704.3 Whenever a player would get priority, the game checks ... for state-based actions, // Rule 704.3 Whenever a player would get priority, the game checks ... for state-based actions,
game.getAction().checkStateEffects(); game.getAction().checkStateEffects();
if (game.isGameOver()) if (game.isGameOver())
return; // state-based effects check could lead to game over return; // state-based effects check could lead to game over
Player whoAddsToStack = pPlayerPriority; Player whoAddsToStack = playerTurn;
do { do {
game.getStack().chooseOrderOfSimultaneousStackEntry(whoAddsToStack); addedAnythingToStack |= game.getStack().chooseOrderOfSimultaneousStackEntry(whoAddsToStack);
whoAddsToStack = game.getNextPlayerAfter(whoAddsToStack); whoAddsToStack = game.getNextPlayerAfter(whoAddsToStack);
} while( whoAddsToStack != null && whoAddsToStack != pPlayerPriority); } while( whoAddsToStack != null && whoAddsToStack != pPlayerPriority);
} while(!addedAnythingToStack);
chosenSa = pPlayerPriority.getController().chooseSpellAbilityToPlay(); chosenSa = pPlayerPriority.getController().chooseSpellAbilityToPlay();
if( null == chosenSa ) if( null == chosenSa )