mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-22 03:51:32 +00:00
Fix multiplayer menu breaking pak file names.
This commit is contained in:
parent
89ef66642e
commit
07032bc216
1 changed files with 8 additions and 3 deletions
|
@ -637,14 +637,19 @@ static int QDECL M_Menu_GameOptions_AddMap(const char *fname, qofs_t fsize, time
|
|||
struct mapopts_s *ctx = parm;
|
||||
size_t i;
|
||||
char *ext;
|
||||
char trimmedfname[MAX_QPATH];
|
||||
if (Q_strncasecmp(fname, "maps/", 5))
|
||||
return true; //o.O
|
||||
fname += 5;
|
||||
if (*fname == 'b' && *fname == '_')
|
||||
if (fname[0] == 'b' && fname[1] == '_')
|
||||
return true; //stoopid ammo boxes.
|
||||
ext = strrchr(fname, '.');
|
||||
if (ext && !strcmp(ext, ".bsp"))
|
||||
*ext = 0;
|
||||
if (ext && !strcmp(ext, ".bsp") && ext-fname<sizeof(trimmedfname))
|
||||
{
|
||||
memcpy(trimmedfname, fname, ext-fname);
|
||||
trimmedfname[ext-fname] = 0;
|
||||
fname = trimmedfname;
|
||||
}
|
||||
|
||||
for (i = 0; i < ctx->count; i++)
|
||||
if (!Q_strcasecmp(ctx->maps[i], fname))
|
||||
|
|
Loading…
Reference in a new issue