]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Disable the use .arena and .defi files in mapinfo generation by default until it...
authorMario <mario.mario@y7mail.com>
Thu, 16 Jul 2020 14:25:59 +0000 (00:25 +1000)
committerMario <mario.mario@y7mail.com>
Thu, 16 Jul 2020 14:25:59 +0000 (00:25 +1000)
qcsrc/common/mapinfo.qc
xonotic-common.cfg

index 1a03102186c774203956e03f98e13ec1dd2020a9..23de32c7ca1767aecb8adc9f92f3fd5a961335d0 100644 (file)
@@ -10,6 +10,7 @@
 #endif
 
 bool autocvar_g_mapinfo_arena_compat = true;
+bool autocvar_g_mapinfo_arena_generate = false;
 
 #ifdef MENUQC
 #define WARN_COND false
@@ -301,20 +302,23 @@ float _MapInfo_Generate(string pFilename) // 0: failure, 1: ok ent, 2: ok bsp
        mapMins = '0 0 0';
        mapMaxs = '0 0 0';
 
-       // try for a .arena or .defi file if no .mapinfo exists
-       bool isdefi = false;
-       string arena_fn = _MapInfo_FindArenaFile(pFilename, ".arena");
-       int arena_fh = fopen(arena_fn, FILE_READ);
-       if(arena_fh < 0)
+       if(autocvar_g_mapinfo_arena_generate)
        {
-               isdefi = true;
-               arena_fn = _MapInfo_FindArenaFile(pFilename, ".defi");
-               arena_fh = fopen(arena_fn, FILE_READ);
-       }
-       if(arena_fh >= 0)
-       {
-               _MapInfo_ParseArena(arena_fn, arena_fh, pFilename, NULL, isdefi, true);
-               fclose(arena_fh);
+               // try for .arena or .defi files, as they may have more accurate information
+               bool isdefi = false;
+               string arena_fn = _MapInfo_FindArenaFile(pFilename, ".arena");
+               int arena_fh = fopen(arena_fn, FILE_READ);
+               if(arena_fh < 0)
+               {
+                       isdefi = true;
+                       arena_fn = _MapInfo_FindArenaFile(pFilename, ".defi");
+                       arena_fh = fopen(arena_fn, FILE_READ);
+               }
+               if(arena_fh >= 0)
+               {
+                       _MapInfo_ParseArena(arena_fn, arena_fh, pFilename, NULL, isdefi, true);
+                       fclose(arena_fh);
+               }
        }
 
        for (;;)
index a0c4b679e55aedc283152dc7b07bdf2ecc14efdd..fbdf838ee76f2b0910c963b88fea561bccdd077e 100644 (file)
@@ -150,7 +150,8 @@ set debug_deglobalization_clear 0 "make the new wrappers set globals to NaN afte
 // disabling until it's complete
 set prvm_garbagecollection_enable 0
 
-set g_mapinfo_arena_compat 1 "allow mapinfo data to be pulled directly from .arena and .defi files if they exist, rather than generating .mapinfo files based on their contents"
+set g_mapinfo_arena_compat 1 "allow mapinfo data to be pulled directly from .arena and .defi files if they exist, rather than generating .mapinfo files for them"
+set g_mapinfo_arena_generate 0 "allow mapinfo data to be pulled from .arena and .defi files during generation"
 
 // load console command aliases and settings
 exec commands.cfg