mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
phase won't end if players are allowed to have priority and there are sim-stack entries to be added
This commit is contained in:
@@ -1006,7 +1006,18 @@ public class PhaseHandler implements java.io.Serializable {
|
|||||||
if( DEBUG_PHASES )
|
if( DEBUG_PHASES )
|
||||||
System.out.println(String.format("%s %s: %s passes priority to %s", playerTurn, phase, pPlayerPriority, nextPlayer));
|
System.out.println(String.format("%s %s: %s passes priority to %s", playerTurn, phase, pPlayerPriority, nextPlayer));
|
||||||
if (getFirstPriority() == nextPlayer) {
|
if (getFirstPriority() == nextPlayer) {
|
||||||
if (game.getStack().isEmpty()) {
|
|
||||||
|
if (game.getStack().hasSimultaneousStackEntries() && givePriorityToPlayer)
|
||||||
|
{
|
||||||
|
Player ap = nextPlayer;
|
||||||
|
Player nap = game.getNextPlayerAfter(ap);
|
||||||
|
game.getStack().chooseOrderOfSimultaneousStackEntry(ap);
|
||||||
|
do {
|
||||||
|
game.getStack().chooseOrderOfSimultaneousStackEntry(nap);
|
||||||
|
nap = game.getNextPlayerAfter(nap);
|
||||||
|
} while( nap != ap);
|
||||||
|
// All have passed, but there's something waiting to be added to stack. After that and give them priority again
|
||||||
|
} else if (game.getStack().isEmpty()) {
|
||||||
this.setPriority(this.getPlayerTurn()); // this needs to be set early as we exit the phase
|
this.setPriority(this.getPlayerTurn()); // this needs to be set early as we exit the phase
|
||||||
|
|
||||||
// end phase
|
// end phase
|
||||||
@@ -1014,10 +1025,8 @@ public class PhaseHandler implements java.io.Serializable {
|
|||||||
onPhaseEnd();
|
onPhaseEnd();
|
||||||
advanceToNextPhase();
|
advanceToNextPhase();
|
||||||
onPhaseBegin();
|
onPhaseBegin();
|
||||||
}
|
} else if (!game.getStack().hasSimultaneousStackEntries())
|
||||||
else if (!game.getStack().hasSimultaneousStackEntries()) {
|
|
||||||
game.getStack().resolveStack();
|
game.getStack().resolveStack();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// pass the priority to other player
|
// pass the priority to other player
|
||||||
|
|||||||
Reference in New Issue
Block a user