From 8af36fe36bfa41c17c9bd337ebca430add66957c Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 17 Jul 2020 00:25:59 +1000 Subject: [PATCH] Disable the use .arena and .defi files in mapinfo generation by default until it is more complete --- qcsrc/common/mapinfo.qc | 30 +++++++++++++++++------------- xonotic-common.cfg | 3 ++- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/qcsrc/common/mapinfo.qc b/qcsrc/common/mapinfo.qc index 1a0310218..23de32c7c 100644 --- a/qcsrc/common/mapinfo.qc +++ b/qcsrc/common/mapinfo.qc @@ -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 (;;) diff --git a/xonotic-common.cfg b/xonotic-common.cfg index a0c4b679e..fbdf838ee 100644 --- a/xonotic-common.cfg +++ b/xonotic-common.cfg @@ -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 -- 2.39.2