fixed bug where clients would end up (attempting to) load a different map path than the server, if the map-name contained slashes

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6290 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
sireus
2011-04-20 00:11:55 +00:00
parent 3c52e664c6
commit eeec7a668c
2 changed files with 6 additions and 2 deletions
+5 -1
View File
@@ -3328,7 +3328,11 @@ void process(ENetPacket *packet, int sender, int chan)
}
int qmode = (mode >= GMODE_NUM ? mode - GMODE_NUM : mode);
if(mode==GMODE_DEMO) vi->action = new demoplayaction(newstring(text));
else vi->action = new mapaction(newstring(vi->text), qmode, sender, qmode!=mode);
else
{
char *vmap = newstring(vi->text ? behindpath(vi->text) : "");
vi->action = new mapaction(vmap, qmode, sender, qmode!=mode);
}
break;
}
case SA_KICK:
+1 -1
View File
@@ -141,10 +141,10 @@ static const char * const maplocstr[] = { "not found", "temporary", "custom", "l
int findmappath(const char *mapname, char *filename)
{
if(!mapname[0]) return MAP_NOTFOUND;
string tempname;
if(!filename) filename = tempname;
const char *name = behindpath(mapname);
if(!mapname[0]) return MAP_NOTFOUND;
formatstring(filename)(SERVERMAP_PATH_BUILTIN "%s.cgz", name);
path(filename);
int loc = MAP_NOTFOUND;