From: Mario Date: Tue, 14 Jul 2020 20:16:48 +0000 (+1000) Subject: If the fallback filename is used, always save the first found map, fixes compatibilit... X-Git-Tag: xonotic-v0.8.6~328^2~26 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=db5496b7aa4ad1711bb6927171fac4d56012a39d;p=xonotic%2Fxonotic-data.pk3dir.git If the fallback filename is used, always save the first found map, fixes compatibility with several DeFrag maps --- diff --git a/qcsrc/common/mapinfo.qc b/qcsrc/common/mapinfo.qc index dfced5ae9..29538b621 100644 --- a/qcsrc/common/mapinfo.qc +++ b/qcsrc/common/mapinfo.qc @@ -761,12 +761,12 @@ float MapInfo_isRedundant(string fn, string t) return false; } -bool _MapInfo_ParseArena(int fh, string pFilename, Gametype pGametypeToSet, bool isdefi) +bool _MapInfo_ParseArena(string arena_filename, int fh, string pFilename, Gametype pGametypeToSet, bool isdefi) { // NOTE: .arena files can hold more than 1 map's information! // to handle this, we're going to store gathered information in local variables and save it if we encounter the correct map name bool in_brackets = false; // testing a potential mapinfo section (within brackets) - bool dosave = false; // variables will be stored in map info upon reaching finishing bracket + bool dosave = (arena_filename == strcat("scripts/", pFilename, ((isdefi) ? ".defi" : ".arena"))); // if the map is using the fallback, just accept the first found mapinfo (it's probably correct!) string stored_Map_description = ""; string stored_Map_title = ""; string stored_Map_author = ""; @@ -980,7 +980,7 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, Gamet if(fh >= 0) { _MapInfo_Map_Reset(); - if(_MapInfo_ParseArena(fh, pFilename, pGametypeToSet, isdefi)) + if(_MapInfo_ParseArena(fn, fh, pFilename, pGametypeToSet, isdefi)) goto mapinfo_handled; // skip generation }