]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
If the fallback filename is used, always save the first found map, fixes compatibilit...
authorMario <mario.mario@y7mail.com>
Tue, 14 Jul 2020 20:16:48 +0000 (06:16 +1000)
committerMario <mario.mario@y7mail.com>
Tue, 14 Jul 2020 20:16:48 +0000 (06:16 +1000)
qcsrc/common/mapinfo.qc

index dfced5ae9238e8922379f3bac714dedcf8e7c618..29538b621a4f8f586a0066803c36985fd5a5187c 100644 (file)
@@ -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
                }