From 554b204cf5497f72806e02dee1900abc5f0955e2 Mon Sep 17 00:00:00 2001 From: ehouse Date: Fri, 12 Dec 2008 13:42:52 +0000 Subject: [PATCH] Provide default player names in game info dialog rather than when creating the very first game to fix bug where creating a game with n+m players from a saved game with n yields m blank default names. --- wince/ceginfo.c | 10 +++++++--- wince/cemain.c | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/wince/ceginfo.c b/wince/ceginfo.c index affe47097..543f8aa6d 100755 --- a/wince/ceginfo.c +++ b/wince/ceginfo.c @@ -462,14 +462,18 @@ ceSetColProc( void* closure, XP_U16 player, NewGameColumn col, GameInfoState* giState = (GameInfoState*)closure; XP_U16 resID = resIDForCol( player, col ); const XP_UCHAR* cp; + XP_UCHAR buf[16]; switch( col ) { case NG_COL_PASSWD: case NG_COL_NAME: - if ( NULL == value.ng_cp ) { - cp = ""; - } else { + if ( NULL != value.ng_cp ) { cp = value.ng_cp; + } else if ( col == NG_COL_NAME ) { + cp = buf; + snprintf( cp, sizeof(buf), "Player %d", player + 1 ); + } else { + cp = ""; } ceSetDlgItemText( giState->dlgHdr.hDlg, resID, cp ); break; diff --git a/wince/cemain.c b/wince/cemain.c index 48e727424..95ebfa260 100755 --- a/wince/cemain.c +++ b/wince/cemain.c @@ -1349,7 +1349,7 @@ InitInstance(HINSTANCE hInstance, int nCmdShow ceInitUtilFuncs( globals ); - gi_initPlayerInfo( MPPARM(mpool) &globals->gameInfo, "Player %d" ); + gi_initPlayerInfo( MPPARM(mpool) &globals->gameInfo, NULL ); /* choose one. If none found it's an error. */ #ifndef STUBBED_DICT