- Duplicate: end turns after defining the new rack, not before

- FreeGame: create an additional turn after defining the initial rack
This commit is contained in:
Olivier Teulière 2008-11-23 17:05:13 +00:00
parent b5c63ea6e3
commit 9dc84ed963
2 changed files with 7 additions and 3 deletions

View file

@ -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();
}

View file

@ -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())
{