engine: server: always set sv_background to zero on server shutdown rather than on server dll unload

This commit is contained in:
Alibek Omarov 2024-12-03 21:02:37 +03:00
parent 51fa7d2611
commit 18a973d4f2
2 changed files with 3 additions and 1 deletions

View file

@ -5135,7 +5135,6 @@ void SV_UnloadProgs( void )
// now we can unload cvars // now we can unload cvars
Cvar_FullSet( "host_gameloaded", "0", FCVAR_READ_ONLY ); Cvar_FullSet( "host_gameloaded", "0", FCVAR_READ_ONLY );
Cvar_FullSet( "sv_background", "0", FCVAR_READ_ONLY );
// free entity baselines // free entity baselines
Z_Free( svs.static_entities ); Z_Free( svs.static_entities );

View file

@ -1077,6 +1077,9 @@ void SV_Shutdown( const char *finalmsg )
return; return;
} }
// don't forget to reset sv_background state
Cvar_FullSet( "sv_background", "0", FCVAR_READ_ONLY );
if( COM_CheckString( finalmsg )) if( COM_CheckString( finalmsg ))
Con_Printf( "%s", finalmsg ); Con_Printf( "%s", finalmsg );