From 6bac32e7168308a932ffb2b377b9e7ac10e0c494 Mon Sep 17 00:00:00 2001 From: ehouse Date: Wed, 2 Feb 2005 02:51:05 +0000 Subject: [PATCH] when undoing for purpose of finding last move and there's no pool, don't attempt to replace tiles. --- common/model.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/common/model.c b/common/model.c index 496042340..d1b5603c4 100644 --- a/common/model.c +++ b/common/model.c @@ -572,11 +572,15 @@ model_undoLatestMoves( ModelCtxt* model, PoolContext* pool, &entry.u.move.moveInfo ); } else if ( entry.moveType == TRADE_TYPE ) { - XP_ASSERT ( !!pool ); - replaceNewTiles( model, pool, turn, &entry.u.trade.newTiles ); + 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 ); - assignPlayerTiles( model, turn, &entry.u.trade.oldTiles ); + pool_removeTiles( pool, &entry.u.trade.oldTiles ); + assignPlayerTiles( model, turn, &entry.u.trade.oldTiles ); + } } else if ( entry.moveType == PHONY_TYPE ) {