mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-18 22:26:30 +01:00
fix crash (assertion failure) finding words associated with a cell
when there's a trade above it on the move stack.
This commit is contained in:
parent
9fb5f49595
commit
4402b81bdf
1 changed files with 4 additions and 9 deletions
|
@ -829,7 +829,7 @@ replaceNewTiles( ModelCtxt* model, PoolContext* pool, XP_U16 turn,
|
||||||
model_removePlayerTile( model, turn, index );
|
model_removePlayerTile( model, turn, index );
|
||||||
}
|
}
|
||||||
if ( !!pool ) {
|
if ( !!pool ) {
|
||||||
pool_replaceTiles( pool, tileSet);
|
pool_replaceTiles( pool, tileSet );
|
||||||
}
|
}
|
||||||
} /* replaceNewTiles */
|
} /* replaceNewTiles */
|
||||||
|
|
||||||
|
@ -905,17 +905,12 @@ model_undoLatestMoves( ModelCtxt* model, PoolContext* pool,
|
||||||
undoFromMoveInfo( model, turn, blankTile,
|
undoFromMoveInfo( model, turn, blankTile,
|
||||||
&entry.u.move.moveInfo );
|
&entry.u.move.moveInfo );
|
||||||
} else if ( entry.moveType == TRADE_TYPE ) {
|
} else if ( entry.moveType == TRADE_TYPE ) {
|
||||||
|
replaceNewTiles( model, pool, turn,
|
||||||
|
&entry.u.trade.newTiles );
|
||||||
if ( pool != NULL ) {
|
if ( pool != NULL ) {
|
||||||
/* If there's no pool, assume we're doing this for
|
|
||||||
scoring purposes only. */
|
|
||||||
replaceNewTiles( model, pool, turn,
|
|
||||||
&entry.u.trade.newTiles );
|
|
||||||
|
|
||||||
pool_removeTiles( pool, &entry.u.trade.oldTiles );
|
pool_removeTiles( pool, &entry.u.trade.oldTiles );
|
||||||
assignPlayerTiles( model, turn, &entry.u.trade.oldTiles );
|
|
||||||
}
|
}
|
||||||
|
assignPlayerTiles( model, turn, &entry.u.trade.oldTiles );
|
||||||
} else if ( entry.moveType == PHONY_TYPE ) {
|
} else if ( entry.moveType == PHONY_TYPE ) {
|
||||||
/* nothing to do, since nothing happened */
|
/* nothing to do, since nothing happened */
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue