From ffa7f639c1da47a77fe14c31192a76ca266ccc17 Mon Sep 17 00:00:00 2001 From: zicodxx <> Date: Wed, 23 Jun 2010 12:57:28 +0000 Subject: [PATCH] If no player exists and GameCfg.LasterPlayer is unset, give user a nice default for convenience and - more important - let menu stop to nag about missing callsign and thereby showing the player creation dialogue over and over again --- CHANGELOG.txt | 1 + main/menu.c | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 5d8695657..d7c6869e0 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -3,6 +3,7 @@ D1X-Rebirth Changelog 20100623 -------- main/menu.c, main/newmenu.c, main/newmenu.h, main/net_ipx.c: Making menus recreated on the fly in case resolution or font-size changes; Removing arguments to pass width and height to menu which was not used except on one IPX menu; Fixing measurement of menu strings of type NM_TYPE_INPUT_MENU; Fixing slight bug in freeing IPX netlist +main/menu.c: If no player exists and GameCfg.LasterPlayer is unset, give user a nice default for convenience and - more important - let menu stop to nag about missing callsign and thereby showing the player creation dialogue over and over again 20100622 -------- diff --git a/main/menu.c b/main/menu.c index 676acf160..371f13340 100644 --- a/main/menu.c +++ b/main/menu.c @@ -321,11 +321,16 @@ int RegisterPlayer() if ( Players[Player_num].callsign[0] == 0 ) { - // Read the last player's name from config file, not lastplr.txt - strncpy( Players[Player_num].callsign, GameCfg.LastPlayer, CALLSIGN_LEN ); - if (GameCfg.LastPlayer[0]==0) + { + strncpy( Players[Player_num].callsign, "player", CALLSIGN_LEN ); allow_abort_flag = 0; + } + else + { + // Read the last player's name from config file, not lastplr.txt + strncpy( Players[Player_num].callsign, GameCfg.LastPlayer, CALLSIGN_LEN ); + } } list = PHYSFSX_findFiles(GameArg.SysUsePlayersDir ? "Players/" : "", types);