From: Mario Date: Sun, 12 Jan 2020 13:00:29 +0000 (+1000) Subject: Automatically detect .arena files instead of adding a settemp hack to generated ... X-Git-Tag: xonotic-v0.8.5~1105^2~23 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b253a57934d122e2a90238e20b935af6d060d862;p=xonotic%2Fxonotic-data.pk3dir.git Automatically detect .arena files instead of adding a settemp hack to generated .mapinfo files --- diff --git a/qcsrc/common/mapinfo.qc b/qcsrc/common/mapinfo.qc index 3bb04b369..d0931b698 100644 --- a/qcsrc/common/mapinfo.qc +++ b/qcsrc/common/mapinfo.qc @@ -843,9 +843,6 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, Gamet fputs(fh, sprintf("gametype %s // defaults: %s\n", MapInfo_Type_ToString(it), _MapInfo_GetDefaultEx(it))); }); - if(fexists(strcat("scripts/", pFilename, ".arena"))) - fputs(fh, "settemp_for_type all sv_q3acompat_machineshotgunswap 1\n"); - fputs(fh, "// optional: fog density red green blue alpha mindist maxdist\n"); fputs(fh, "// optional: settemp_for_type (all|gametypename) cvarname value\n"); fputs(fh, "// optional: clientsettemp_for_type (all|gametypename) cvarname value\n"); diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index 6ee29474e..aed2d2ef5 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -872,6 +872,9 @@ spawnfunc(worldspawn) MapInfo_Enumerate(); MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 1); + if(fexists(strcat("scripts/", mapname, ".arena"))) + cvar_settemp("sv_q3acompat_machineshotgunswap", "1"); + if(fexists(strcat("scripts/", mapname, ".defi"))) cvar_settemp("sv_q3defragcompat", "1");