eliot-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Eliot-dev] eliot/game freegame.cpp


From: eliot-dev
Subject: [Eliot-dev] eliot/game freegame.cpp
Date: Tue, 12 Feb 2008 21:02:39 +0000

CVSROOT:        /cvsroot/eliot
Module name:    eliot
Changes by:     Olivier Teulière <ipkiss>      08/02/12 21:02:39

Modified files:
        game           : freegame.cpp 

Log message:
        Do not try to complete the rack when no letter was removed

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/eliot/game/freegame.cpp?cvsroot=eliot&r1=1.19&r2=1.20

Patches:
Index: freegame.cpp
===================================================================
RCS file: /cvsroot/eliot/eliot/game/freegame.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- freegame.cpp        8 Jan 2008 13:52:38 -0000       1.19
+++ freegame.cpp        12 Feb 2008 21:02:39 -0000      1.20
@@ -32,6 +32,7 @@
 #include "player.h"
 #include "ai_player.h"
 #include "settings.h"
+#include "turn.h"
 
 #include "debug.h"
 
@@ -130,12 +131,17 @@
 int FreeGame::endTurn()
 {
     // 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)
     {
         // End of the game
         endGame();
         return 1;
     }
+    }
 
     // Next player
     nextPlayer();




reply via email to

[Prev in Thread] Current Thread [Next in Thread]