]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a temporary cvar to mapinfo generation to fix an issue with VQ3 maps
authorMario <zacjardine@y7mail.com>
Sat, 15 Sep 2018 18:26:21 +0000 (04:26 +1000)
committerMario <zacjardine@y7mail.com>
Sat, 15 Sep 2018 18:26:21 +0000 (04:26 +1000)
qcsrc/common/mapinfo.qc
qcsrc/common/mapobjects/trigger/hurt.qc
qcsrc/server/autocvars.qh
xonotic-server.cfg

index 0884bc8d79054c29d6d88bacb75ad88de011e09b..f002f84b8316de8b7aed5c4a29acf46b13948928 100644 (file)
@@ -854,6 +854,9 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, Gamet
                        if(fexists(strcat("scripts/", pFilename, ".arena")))
                                fputs(fh, "settemp_for_type all sv_q3acompat_machineshotgunswap 1\n");
 
+                       if(fexists(strcat("scripts/", pFilename, ".defi")))
+                               fputs(fh, "settemp_for_type all sv_vq3compat_triggerhurtdamage 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 f517151b399cf8d68cb1d98753a083f829141e68..5d38783ccdb8778c1968a57f4bfd8b312f4ab3b2 100644 (file)
@@ -25,7 +25,7 @@ void trigger_hurt_touch(entity this, entity toucher)
                if (toucher.triggerhurttime < time)
                {
                        EXACTTRIGGER_TOUCH(this, toucher);
-                       toucher.triggerhurttime = time + 1;
+                       toucher.triggerhurttime = time + ((autocvar_sv_vq3compat_triggerhurtdamage) ? 0.2 : 1);
 
                        entity own;
                        own = this.enemy;
@@ -66,7 +66,7 @@ spawnfunc(trigger_hurt)
        this.use = trigger_hurt_use;
        this.enemy = world; // I hate you all
        if (!this.dmg)
-               this.dmg = 10000;
+               this.dmg = ((autocvar_sv_vq3compat_triggerhurtdamage) ? 5 : 10000);
        if (this.message == "")
                this.message = "was in the wrong place";
        if (this.message2 == "")
index 4e180f731b2acd7d95efb8e74ba75b091f47f4c8..d4997b99a5ad805655c630ff414b78fbbdec194a 100644 (file)
@@ -316,6 +316,7 @@ string autocvar_sv_motd;
 bool autocvar_sv_precacheplayermodels;
 //float autocvar_sv_precacheweapons; // WEAPONTODO?
 bool autocvar_sv_q3acompat_machineshotgunswap;
+bool autocvar_sv_vq3compat_triggerhurtdamage;
 bool autocvar_sv_servermodelsonly;
 int autocvar_sv_spectate;
 float autocvar_sv_spectator_speed_multiplier;
index 92ca3647b5098b0dae2d1e64abdb4af54ad88d25..9134f319dd45712e11b097bbc959e5f855e41624 100644 (file)
@@ -483,6 +483,7 @@ sv_gameplayfix_gravityunaffectedbyticrate 1
 sv_gameplayfix_nogravityonground 1
 
 set sv_q3acompat_machineshotgunswap 0 "shorthand for swapping machinegun and shotgun (for Q3A map compatibility in mapinfo files)"
+set sv_vq3compat_triggerhurtdamage 0 "shorthand for swapping trigger_hurt damage and hit time (for VQ3 and CPM map compatibility in mapinfo files)"
 
 set g_movement_highspeed 1 "movement speed modification factor (only changes movement when above maxspeed)"