mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-30 10:26:58 +01:00
remove undo as an option for duplicate mode games
This commit is contained in:
parent
345f104505
commit
818868bdb2
2 changed files with 16 additions and 10 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue