]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Automatically detect .arena files instead of adding a settemp hack to generated ...
authorMario <mario.mario@y7mail.com>
Sun, 12 Jan 2020 13:00:29 +0000 (23:00 +1000)
committerMario <mario.mario@y7mail.com>
Sun, 12 Jan 2020 13:00:29 +0000 (23:00 +1000)
qcsrc/common/mapinfo.qc
qcsrc/server/g_world.qc

index 3bb04b369505ca3be712bc5d7c46b2c952e6abac..d0931b6983df28006d069fd3d5acffc2b3630048 100644 (file)
@@ -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");
index 6ee29474e5470944cf7122279c8213ecd91f57a4..aed2d2ef52fdcf87c1d5165c9f1f2a6699836849 100644 (file)
@@ -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");