mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-16 15:41:16 +01:00
set gameID when saving CurGameInfo from java IFF it isn't already set.
This commit is contained in:
parent
84ebc38882
commit
919c7be9d6
3 changed files with 10 additions and 1 deletions
|
@ -253,7 +253,7 @@ and_util_altKeyDown( XW_UtilCtxt* uc )
|
|||
}
|
||||
|
||||
|
||||
static XP_U32
|
||||
XP_U32
|
||||
and_util_getCurSeconds( XW_UtilCtxt* uc )
|
||||
{
|
||||
struct timeval tv;
|
||||
|
|
|
@ -33,4 +33,6 @@ void destroyUtil( XW_UtilCtxt** util );
|
|||
|
||||
bool utilTimerFired( XW_UtilCtxt* util, XWTimerReason why, int handle );
|
||||
|
||||
XP_U32 and_util_getCurSeconds( XW_UtilCtxt* uc ); /* uc can be NULL */
|
||||
|
||||
#endif
|
||||
|
|
|
@ -165,6 +165,13 @@ Java_org_eehouse_android_xw4_jni_XwJNI_gi_1to_1stream
|
|||
XWStreamCtxt* stream = mem_stream_make( MPPARM(mpool) vtMgr,
|
||||
NULL, 0, NULL );
|
||||
|
||||
/* Unlike on other platforms, gi is created without a call to
|
||||
game_makeNewGame, which sets gameID. So check here if it's still unset
|
||||
and if necessary set it. */
|
||||
while ( 0 == gi->gameID ) {
|
||||
gi->gameID = and_util_getCurSeconds( NULL );
|
||||
}
|
||||
|
||||
game_saveToStream( NULL, gi, stream );
|
||||
destroyGI( MPPARM(mpool) &gi );
|
||||
|
||||
|
|
Loading…
Reference in a new issue