From 07032bc216305808f6adb278cf6afad84858ed39 Mon Sep 17 00:00:00 2001 From: Shpoike Date: Thu, 19 Jan 2023 00:20:35 +0000 Subject: [PATCH] Fix multiplayer menu breaking pak file names. --- engine/client/m_multi.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/engine/client/m_multi.c b/engine/client/m_multi.c index cf99a56d1..718c669fd 100644 --- a/engine/client/m_multi.c +++ b/engine/client/m_multi.c @@ -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-fnamecount; i++) if (!Q_strcasecmp(ctx->maps[i], fname))