mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-02-01 13:40:59 +00:00
Merge pull request #592 from earth-metal/master
Start Server Menu: reload "maps.lst" after "game" dir is changed
This commit is contained in:
commit
2bb6fdf4a8
3 changed files with 11 additions and 3 deletions
|
@ -2836,8 +2836,8 @@ M_Menu_JoinServer_f(void)
|
|||
*/
|
||||
|
||||
static menuframework_s s_startserver_menu;
|
||||
static char **mapnames = NULL;
|
||||
static int nummaps = 0;
|
||||
char **mapnames = NULL;
|
||||
static int nummaps;
|
||||
|
||||
static menuaction_s s_startserver_start_action;
|
||||
static menuaction_s s_startserver_dmoptions_action;
|
||||
|
@ -2997,11 +2997,14 @@ StartServer_MenuInit(void)
|
|||
char *s;
|
||||
float scale = SCR_GetMenuScale();
|
||||
|
||||
/* initialize list of maps once, reuse it afterwards (=> it isn't freed) */
|
||||
/* initialize list of maps once, reuse it afterwards (=> it isn't freed unless the game dir is changed) */
|
||||
if (mapnames == NULL)
|
||||
{
|
||||
int i, length;
|
||||
|
||||
nummaps = 0;
|
||||
s_startmap_list.curvalue = 0;
|
||||
|
||||
/* load the list of map names */
|
||||
if ((length = FS_LoadFile("maps.lst", (void **)&buffer)) == -1)
|
||||
{
|
||||
|
|
|
@ -1672,6 +1672,10 @@ FS_BuildGameSpecificSearchPath(char *dir)
|
|||
// list of music tracks needs to be loaded again (=> tracks
|
||||
// are possibly from the new mod dir)
|
||||
OGG_InitTrackList();
|
||||
|
||||
// ...and the current list of maps in the "start network server" menu is
|
||||
// cleared so that it will be re-initialized when the menu is accessed
|
||||
mapnames = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -754,6 +754,7 @@ extern char cfgdir[MAX_OSPATH];
|
|||
|
||||
/* Hack for working 'game' cmd */
|
||||
extern char userGivenGame[MAX_QPATH];
|
||||
extern char **mapnames;
|
||||
|
||||
extern FILE *log_stats_file;
|
||||
|
||||
|
|
Loading…
Reference in a new issue