From 86ed9d21276c5b59f503789a9edb1ee5895065c8 Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 15 Jul 2020 05:48:56 +1000 Subject: [PATCH] Perform a search for brackets instead of relying on them being at the start of the line with no trailing details, fixes compatibility with several maps, also fix compatibility with maps that capitalize parameters in .arena files --- qcsrc/common/mapinfo.qc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qcsrc/common/mapinfo.qc b/qcsrc/common/mapinfo.qc index 3c92efeab..dfced5ae9 100644 --- a/qcsrc/common/mapinfo.qc +++ b/qcsrc/common/mapinfo.qc @@ -786,7 +786,7 @@ bool _MapInfo_ParseArena(int fh, string pFilename, Gametype pGametypeToSet, bool continue; if(substring(s, 0, 1) == "_") // q3map style continue; - if(s == "{") + if(strstrofs(s, "{", 0) >= 0) { if(in_brackets) return false; // edge case? already in a bracketed section! @@ -798,7 +798,7 @@ bool _MapInfo_ParseArena(int fh, string pFilename, Gametype pGametypeToSet, bool // if we're not inside a bracket, don't process map info continue; } - if(s == "}" || s == " }") // check for a space (common practice in kool maps) + if(strstrofs(s, "}", 0) >= 0) { if(!in_brackets) return false; // no starting bracket! let the mapinfo generation system handle it @@ -838,6 +838,7 @@ bool _MapInfo_ParseArena(int fh, string pFilename, Gametype pGametypeToSet, bool s = substring(s, 1, -1); t = car(s); s = cdr(s); + t = strtolower(t); // apparently some q3 maps use capitalized parameters // remove trailing spaces while(substring(t, -1, 1) == " ") -- 2.39.2