From f9af9493d268fca01a0e1c02e898e1546b74c659 Mon Sep 17 00:00:00 2001 From: Antoine Fraboulet Date: Fri, 11 Aug 2006 22:12:10 +0000 Subject: [PATCH] - bug correction for game::play when playing on a joker tile --- game/board.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/game/board.cpp b/game/board.cpp index c1820a9..3e13279 100644 --- a/game/board.cpp +++ b/game/board.cpp @@ -26,6 +26,7 @@ #include "rack.h" #include "results.h" #include "board.h" +#include "debug.h" #define oo 0 #define __ 1 @@ -266,7 +267,22 @@ int Board::checkRoundAux(Matrix &iTilesMx, { /* There is already a letter on the board */ if (iTilesMx[row][col + i] != t) - return 2; + { + /* check if it is only a joker */ + if ((iTilesMx[row][col+i].toCode() == t.toCode()) && iTilesMx[row][col+i].isJoker()) + { + // do nothing, we don't need to change the tile in the round + // iRound.setJoker(i,true); + debug("load: play on joker for letter %d (%c)\n",i,iRound.getTile(i).toChar()); + } + else + { + debug("load: overwriting tile %c with %c\n", + iTilesMx[row][col+i].toChar(), + t.toChar()); + return 2; + } + } isolated = false; iRound.setFromBoard(i);