From: Mario Date: Tue, 14 Jul 2020 19:48:56 +0000 (+1000) Subject: Perform a search for brackets instead of relying on them being at the start of the... X-Git-Tag: xonotic-v0.8.6~328^2~27 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=86ed9d21276c5b59f503789a9edb1ee5895065c8;p=xonotic%2Fxonotic-data.pk3dir.git 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 --- 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) == " ")