mirror of
git://git.savannah.nongnu.org/eliot.git
synced 2024-11-16 07:47:39 +01:00
Check the played word against the game rack, not against the current player rack.
This is the same in most cases, except for arbitration games where current player may already have an assigned move. This change notably fixes a bug when using the "Check word" button in arbitration mode: if the current player already had an assigned move, the checked move would often be considered invalid (wrongly).
This commit is contained in:
parent
3ad45fdb91
commit
10f5e98747
2 changed files with 3 additions and 3 deletions
|
@ -661,10 +661,9 @@ int Game::checkPlayedWord(const wstring &iCoord,
|
|||
if (checkWordAndJunction && checkRack)
|
||||
{
|
||||
// Check that the word can be formed with the tiles in the rack:
|
||||
// we first create a copy of the rack, then we remove the tiles
|
||||
// we first create a copy of the game rack, then we remove the tiles
|
||||
// one by one
|
||||
Player *player = m_players[m_currPlayer];
|
||||
Rack rack = player->getCurrentRack().getRack();
|
||||
Rack rack = getHistory().getCurrentRack().getRack();
|
||||
|
||||
Tile t;
|
||||
for (unsigned int i = 0; i < round.getWordLen(); i++)
|
||||
|
|
|
@ -173,6 +173,7 @@ public:
|
|||
|
||||
/// Return true if the player has played for the current turn
|
||||
// XXX: not very nice API, should be a player property...
|
||||
// XXX: this implementation makes no sense in arbitration mode.
|
||||
virtual bool hasPlayed(unsigned int player) const { return player != currPlayer(); }
|
||||
|
||||
/***************
|
||||
|
|
Loading…
Reference in a new issue