mirror of
git://git.savannah.nongnu.org/eliot.git
synced 2025-01-29 20:34:56 +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 "ai_player.h"
|
||||
#include "settings.h"
|
||||
#include "turn.h"
|
||||
|
||||
#include "debug.h"
|
||||
|
||||
|
@ -130,11 +131,16 @@ int FreeGame::start()
|
|||
int FreeGame::endTurn()
|
||||
{
|
||||
// Complete the rack for the player that just played
|
||||
if (helperSetRackRandom(m_currPlayer, false, RACK_NEW) == 1)
|
||||
const Move &move = m_history.getPreviousTurn().getMove();
|
||||
if (move.getType() == Move::VALID_ROUND ||
|
||||
move.getType() == Move::CHANGE_LETTERS)
|
||||
{
|
||||
// End of the game
|
||||
endGame();
|
||||
return 1;
|
||||
if (helperSetRackRandom(m_currPlayer, false, RACK_NEW) == 1)
|
||||
{
|
||||
// End of the game
|
||||
endGame();
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
// Next player
|
||||
|
|
Loading…
Add table
Reference in a new issue