Fix bug where if word being scored for long-touch-on-scoreboard wasn't

in current player's dictionary it'd show up empty: word, once played,
needn't be legal to be displayed.
This commit is contained in:
Eric House 2012-08-12 19:25:16 -07:00
parent eb8401bb7a
commit 07912bdcdb
4 changed files with 6 additions and 18 deletions

View file

@ -725,14 +725,6 @@ figureCrosschecks( EngineCtxt* engine, XP_U16 x, XP_U16 y, XP_U16* scoreP,
}
} /* figureCrosschecks */
XP_Bool
engine_check( DictionaryCtxt* dict, Tile* tiles, XP_U16 nTiles )
{
array_edge* in_edge = dict_getTopEdge( dict );
return lookup( dict, in_edge, tiles, 0, nTiles );
} /* engine_check */
static Tile
localGetBoardTile( EngineCtxt* engine, XP_U16 col, XP_U16 row,
XP_Bool substBlank )

View file

@ -59,7 +59,6 @@ XP_Bool engine_findMove( EngineCtxt* ctxt, const ModelCtxt* model,
XP_Bool useTileLimits,
#endif
XP_U16 robotIQ, XP_Bool* canMove, MoveInfo* result );
XP_Bool engine_check( DictionaryCtxt* dict, Tile* buf, XP_U16 buflen );
#ifdef CPLUS
}

View file

@ -2146,18 +2146,17 @@ typedef struct _FirstWordData {
} FirstWordData;
static XP_Bool
getFirstWord( const XP_UCHAR* word, XP_Bool isLegal,
getFirstWord( const XP_UCHAR* word, XP_Bool XP_UNUSED_DBG(isLegal),
#ifdef XWFEATURE_BOARDWORDS
const MoveInfo* XP_UNUSED(movei), XP_U16 XP_UNUSED(start),
XP_U16 XP_UNUSED(end),
#endif
void* closure )
{
if ( isLegal ) {
FirstWordData* data = (FirstWordData*)closure;
if ( '\0' == data->word[0] && '\0' != word[0] ) {
XP_STRCAT( data->word, word );
}
XP_ASSERT( isLegal );
FirstWordData* data = (FirstWordData*)closure;
if ( '\0' == data->word[0] && '\0' != word[0] ) {
XP_STRCAT( data->word, word );
}
return XP_TRUE;
}

View file

@ -669,12 +669,10 @@ scoreWord( const ModelCtxt* model, XP_U16 turn,
if ( !!notifyInfo ) {
XP_U16 len = curTile - checkWordBuf;
XP_Bool legal = engine_check( dict, checkWordBuf, len );
XP_UCHAR buf[(MAX_ROWS*2)+1];
dict_tilesToString( dict, checkWordBuf, len, buf,
sizeof(buf) );
(void)(*notifyInfo->proc)( buf, legal,
(void)(*notifyInfo->proc)( buf, XP_TRUE, /* it's "legal" here */
#ifdef XWFEATURE_BOARDWORDS
movei, start, end,
#endif