From f07eea5073c0ce6d8f285aa746f841c2d57a306b Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sat, 28 Oct 2023 11:14:12 +0300 Subject: [PATCH] engine: server: allow server unloading for Win32 targets until we figure out the issues with MetaMod --- engine/server/sv_game.c | 6 ++++++ engine/server/sv_main.c | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/engine/server/sv_game.c b/engine/server/sv_game.c index aac91db0..7462ac95 100644 --- a/engine/server/sv_game.c +++ b/engine/server/sv_game.c @@ -5148,7 +5148,13 @@ qboolean SV_LoadProgs( const char *name ) edict_t *e; if( svgame.hInstance ) + { +#if XASH_WIN32 + SV_UnloadProgs(); +#else // XASH_WIN32 return true; +#endif // XASH_WIN32 + } // fill it in svgame.pmove = &gpMove; diff --git a/engine/server/sv_main.c b/engine/server/sv_main.c index 4d012391..9b30ab17 100644 --- a/engine/server/sv_main.c +++ b/engine/server/sv_main.c @@ -1090,6 +1090,10 @@ void SV_Shutdown( const char *finalmsg ) // drop the client if want to load a new map if( CL_IsPlaybackDemo( )) CL_Drop(); + +#if XASH_WIN32 + SV_UnloadProgs(); +#endif // XASH_WIN32 return; } @@ -1107,6 +1111,9 @@ void SV_Shutdown( const char *finalmsg ) NET_Config( false, false ); SV_DeactivateServer(); +#if XASH_WIN32 + SV_UnloadProgs(); +#endif // XASH_WIN32 CL_Drop(); // free current level