Remove any trailing ".bsp" from mapname

git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@313 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
stevenaaus 2010-08-29 23:03:50 +00:00
parent 95c62ee9c6
commit f37e8be035

View file

@ -827,6 +827,7 @@ void Host_Map_f (void)
key_dest = key_game; // remove console or menu
SCR_BeginLoadingPlaque ();
// mapstring isn't used anywhere!
cls.mapstring[0] = 0;
for (i = 0; i < Cmd_Argc(); i++)
{
@ -836,7 +837,17 @@ void Host_Map_f (void)
strcat (cls.mapstring, "\n");
svs.serverflags = 0; // haven't completed an episode yet
strcpy (name, Cmd_Argv(1));
// remove (any) trailing ".bsp" from mapname S.A.
char mapname[64], *needle;
strcpy (mapname, Cmd_Argv(1));
needle = strstr(mapname,".bsp");
if (needle && (needle + 4 == mapname + Q_strlen(mapname)))
needle[0] = '\0';
strcpy (name, mapname);
SV_SpawnServer (name);
if (!sv.active)
return;