mirror of
git://git.savannah.nongnu.org/eliot.git
synced 2025-02-06 08:48:21 +01:00
Do not try to complete the rack when no letter was removed
This commit is contained in:
parent
52b7363888
commit
0acc5cd48f
1 changed files with 10 additions and 4 deletions
|
@ -32,6 +32,7 @@
|
||||||
#include "player.h"
|
#include "player.h"
|
||||||
#include "ai_player.h"
|
#include "ai_player.h"
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
|
#include "turn.h"
|
||||||
|
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
|
@ -130,12 +131,17 @@ int FreeGame::start()
|
||||||
int FreeGame::endTurn()
|
int FreeGame::endTurn()
|
||||||
{
|
{
|
||||||
// Complete the rack for the player that just played
|
// Complete the rack for the player that just played
|
||||||
|
const Move &move = m_history.getPreviousTurn().getMove();
|
||||||
|
if (move.getType() == Move::VALID_ROUND ||
|
||||||
|
move.getType() == Move::CHANGE_LETTERS)
|
||||||
|
{
|
||||||
if (helperSetRackRandom(m_currPlayer, false, RACK_NEW) == 1)
|
if (helperSetRackRandom(m_currPlayer, false, RACK_NEW) == 1)
|
||||||
{
|
{
|
||||||
// End of the game
|
// End of the game
|
||||||
endGame();
|
endGame();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Next player
|
// Next player
|
||||||
nextPlayer();
|
nextPlayer();
|
||||||
|
|
Loading…
Add table
Reference in a new issue