clear pending move before applying phonies rejection

If slow network traffic has given a guest time to move tiles to the
board while the host decides its last move must be rejected, those tiles
must be removed before the rejected turn can be undone.
This commit is contained in:
Eric House 2020-04-21 22:28:20 -07:00
parent 9d04b97ec8
commit 0dc39b5d85

View file

@ -902,6 +902,8 @@ model_rejectPreviousMove( ModelCtxt* model, PoolContext* pool, XP_U16* turn )
stack_popEntry( stack, &entry ); stack_popEntry( stack, &entry );
XP_ASSERT( entry.moveType == MOVE_TYPE ); XP_ASSERT( entry.moveType == MOVE_TYPE );
model_resetCurrentTurn( model, entry.playerNum );
replaceNewTiles( model, pool, entry.playerNum, &entry.u.move.newTiles ); replaceNewTiles( model, pool, entry.playerNum, &entry.u.move.newTiles );
XP_ASSERT( !model->vol.gi->inDuplicateMode ); XP_ASSERT( !model->vol.gi->inDuplicateMode );
undoFromMove( model, entry.playerNum, blankTile, &entry.u.move ); undoFromMove( model, entry.playerNum, blankTile, &entry.u.move );