remove undo as an option for duplicate mode games

This commit is contained in:
Eric House 2022-08-03 19:54:53 -07:00
parent 345f104505
commit 818868bdb2
2 changed files with 16 additions and 10 deletions

View file

@ -955,12 +955,16 @@ model_rejectPreviousMove( ModelCtxt* model, XWEnv xwe,
XP_Bool
model_canUndo( const ModelCtxt* model )
{
const StackCtxt* stack = model->vol.stack;
XP_U16 nStackEntries = stack_getNEntries( stack );
/* PENDING Turning off undo for duplicate mode for now. */
XP_Bool result = !model->vol.gi->inDuplicateMode;
if ( result ) {
const StackCtxt* stack = model->vol.stack;
XP_U16 nStackEntries = stack_getNEntries( stack );
/* More than just tile assignment? */
XP_U16 assignCount = model->vol.gi->inDuplicateMode ? 1 : model->nPlayers;
XP_Bool result = nStackEntries > assignCount;
/* More than just tile assignment? */
XP_U16 assignCount = model->vol.gi->inDuplicateMode ? 1 : model->nPlayers;
result = nStackEntries > assignCount;
}
return result;
}

View file

@ -1026,12 +1026,14 @@ static void
setPrevMoveStream( ServerCtxt* server, XWEnv xwe, XWStreamCtxt* stream )
{
if ( !server->nv._prevMoveStream ) {
server->nv._prevMoveStream = mkServerStream( server );
server->nv._prevMoveStream = stream;
// mkServerStream( server );
} else {
XP_LOGFF( "appending to existing stream" );
stream_putBytes( server->nv._prevMoveStream, stream_getPtr( stream ),
stream_getSize( stream ) );
stream_destroy( stream, xwe );
}
XP_ASSERT( '\0' != ((XP_UCHAR*)stream_getPtr( stream ))[0] );
stream_putBytes( server->nv._prevMoveStream, stream_getPtr( stream ),
stream_getSize( stream ) );
stream_destroy( stream, xwe );
}
static void