Skip to content

Commit

Permalink
mint-arena: Fix setting gametype in in-game 'start new arena' menu
Browse files Browse the repository at this point in the history
The first menu with gametype/map selection set g_gametype immediately
which changed the current gametype (bypassing CVAR_LATCH). Defer setting
g_gametype until choosing to change map and apply settings.
  • Loading branch information
zturtleman committed Sep 17, 2024
1 parent 87ea5a0 commit 6755ee5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions code/q3_ui/ui_startserver.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,6 @@ static void StartServer_MenuEvent( void* ptr, int event ) {
break;

case ID_STARTSERVERNEXT:
trap_Cvar_SetValue( "g_gameType", gametype_remap[s_startserver.gametype.curvalue] );
UI_ServerOptionsMenu( s_startserver.multiplayer );
break;

Expand Down Expand Up @@ -893,7 +892,8 @@ static void ServerOptions_Start( void ) {

// the wait commands will allow the dedicated to take effect
info = UI_GetArenaInfoByNumber( s_startserver.maplist[ s_startserver.currentmap ]);
trap_Cmd_ExecuteText( EXEC_APPEND, va( "wait ; wait ; map %s\n", Info_ValueForKey( info, "map" )));
trap_Cmd_ExecuteText( EXEC_APPEND, va( "wait ; wait ; g_gametype %d ; map %s\n",
s_serveroptions.gametype, Info_ValueForKey( info, "map" ) ) );

// remove bots
if ( trap_Cvar_VariableValue("sv_running") ) {
Expand Down Expand Up @@ -1405,8 +1405,7 @@ static void ServerOptions_MenuInit( qboolean multiplayer ) {

memset( &s_serveroptions, 0 ,sizeof(serveroptions_t) );
s_serveroptions.multiplayer = multiplayer;
s_serveroptions.gametype = (int) Com_Clamp(0, ARRAY_LEN(gametype_remap2) - 1,
trap_Cvar_VariableValue("g_gametype"));
s_serveroptions.gametype = gametype_remap[s_startserver.gametype.curvalue];

ServerOptions_Cache();

Expand Down

0 comments on commit 6755ee5

Please sign in to comment.