diff --git a/game/duplicate.cpp b/game/duplicate.cpp index 7b00a6a..51f8d6e 100644 --- a/game/duplicate.cpp +++ b/game/duplicate.cpp @@ -116,6 +116,11 @@ void Duplicate::start() // Nobody has played yet in this round m_hasPlayed[i] = false; } + // Change the turn _after_ setting the new rack, so that when going + // back in the history the rack is already there. The turn boundaries + // must be just before player actions, otherwise restoring the game + // doesn't work properly. + accessNavigation().newTurn(); } catch (EndGameException &e) { @@ -196,7 +201,6 @@ void Duplicate::endTurn() if (bestPlayer == NULL) { // Nobody played a valid round. Go to the next turn... - accessNavigation().newTurn(); start(); return; } @@ -253,8 +257,6 @@ void Duplicate::endTurn() } } - accessNavigation().newTurn(); - // Start next turn... start(); } diff --git a/game/freegame.cpp b/game/freegame.cpp index 26e534c..7abcc45 100644 --- a/game/freegame.cpp +++ b/game/freegame.cpp @@ -128,6 +128,8 @@ void FreeGame::start() m_currPlayer = 0; + accessNavigation().newTurn(); + // If the first player is an AI, make it play now if (!m_players[m_currPlayer]->isHuman()) {