From: divverent Date: Tue, 11 May 2010 15:51:15 +0000 (+0000) Subject: two more obvious bugs in worldnamenoextension X-Git-Tag: xonotic-v0.1.0preview~230^2~286 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=59521431b3fab534a48931527bc6e6a3053a8bd1;p=xonotic%2Fdarkplaces.git two more obvious bugs in worldnamenoextension git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10192 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cl_parse.c b/cl_parse.c index 04819e73..26016844 100644 --- a/cl_parse.c +++ b/cl_parse.c @@ -1794,7 +1794,7 @@ void CL_ParseServerInfo (void) // set the base name for level-specific things... this gets updated again by CL_SetupWorldModel later strlcpy(cl.worldname, cl.model_name[1], sizeof(cl.worldname)); FS_StripExtension(cl.worldname, cl.worldnamenoextension, sizeof(cl.worldnamenoextension)); - strlcpy(cl.worldbasename, !strncmp(cl.worldnamenoextension, "maps/", 5) ? cl.worldnamenoextension + 4 : cl.worldnamenoextension, sizeof(cl.worldbasename)); + strlcpy(cl.worldbasename, !strncmp(cl.worldnamenoextension, "maps/", 5) ? cl.worldnamenoextension + 5 : cl.worldnamenoextension, sizeof(cl.worldbasename)); Cvar_SetQuick(&cl_worldmessage, cl.worldmessage); Cvar_SetQuick(&cl_worldname, cl.worldname); Cvar_SetQuick(&cl_worldnamenoextension, cl.worldnamenoextension); diff --git a/sv_main.c b/sv_main.c index 913485b5..32abfe34 100644 --- a/sv_main.c +++ b/sv_main.c @@ -3172,7 +3172,7 @@ void SV_SpawnServer (const char *server) strlcpy (sv.name, server, sizeof (sv.name)); strlcpy(sv.worldname, modelname, sizeof(sv.worldname)); FS_StripExtension(sv.worldname, sv.worldnamenoextension, sizeof(sv.worldnamenoextension)); - strlcpy(sv.worldbasename, !strncmp(sv.worldnamenoextension, "maps/", 5) ? sv.worldnamenoextension + 4 : sv.worldnamenoextension, sizeof(sv.worldbasename)); + strlcpy(sv.worldbasename, !strncmp(sv.worldnamenoextension, "maps/", 5) ? sv.worldnamenoextension + 5 : sv.worldnamenoextension, sizeof(sv.worldbasename)); //Cvar_SetQuick(&sv_worldmessage, sv.worldmessage); // set later after QC is spawned Cvar_SetQuick(&sv_worldname, sv.worldname); Cvar_SetQuick(&sv_worldnamenoextension, sv.worldnamenoextension);