From f7c536b81c81886caa8c02d83a9e804b9d1b89d7 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sun, 29 Oct 2023 02:44:46 +0300 Subject: [PATCH] engine: server: allow loading maps from subdirectories as this is used by some Half-Life mods --- engine/server/sv_init.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/engine/server/sv_init.c b/engine/server/sv_init.c index d4eebd62..781d5793 100644 --- a/engine/server/sv_init.c +++ b/engine/server/sv_init.c @@ -1041,8 +1041,9 @@ qboolean SV_SpawnServer( const char *mapname, const char *startspot, qboolean ba // force normal player collisions for single player if( svs.maxclients == 1 ) Cvar_SetValue( "sv_clienttrace", 1 ); - // make sure what server name doesn't contain path and extension - COM_FileBase( mapname, sv.name, sizeof( sv.name )); + // allow loading maps from subdirectories, strip extension anyway + Q_strncpy( sv.name, mapname, sizeof( sv.name )); + COM_StripExtension( sv.name ); // precache and static commands can be issued during map initialization Host_SetServerState( ss_loading );