]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Rename the temporary cvar to be a bit more generic in relation to VQ3 compatibility
authorMario <zacjardine@y7mail.com>
Sat, 15 Sep 2018 19:14:13 +0000 (05:14 +1000)
committerMario <zacjardine@y7mail.com>
Sat, 15 Sep 2018 19:14:13 +0000 (05:14 +1000)
qcsrc/common/mapinfo.qc
qcsrc/common/mapobjects/trigger/hurt.qc
qcsrc/common/mapobjects/trigger/hurt.qh
qcsrc/common/mapobjects/trigger/jumppads.qc
qcsrc/common/stats.qh
qcsrc/server/autocvars.qh
xonotic-server.cfg

index f002f84b8316de8b7aed5c4a29acf46b13948928..859ec51d54809709a8fd9a52f922902fed7ee112 100644 (file)
@@ -855,7 +855,7 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, Gamet
                                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, "settemp_for_type all sv_vq3compat 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");
index 5d38783ccdb8778c1968a57f4bfd8b312f4ab3b2..a19c86415e984dcba72cd54e5d33b36084de8503 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 + ((autocvar_sv_vq3compat_triggerhurtdamage) ? 0.2 : 1);
+                       toucher.triggerhurttime = time + ((autocvar_sv_vq3compat && !(this.spawnflags & HURT_SLOW)) ? 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 = ((autocvar_sv_vq3compat_triggerhurtdamage) ? 5 : 10000);
+               this.dmg = ((autocvar_sv_vq3compat) ? 5 : 10000);
        if (this.message == "")
                this.message = "was in the wrong place";
        if (this.message2 == "")
index 6f70f09beec2219624baeca92e2cd7deaa104fb4..e992154aa97fd6a76cd6d7fc6d856ebb356eda4a 100644 (file)
@@ -1 +1,3 @@
 #pragma once
+
+const int HURT_SLOW = BIT(4);
index 5ffdf2d1066085d9bd47fd1dd5d541af179b4671..b32b4d262d90885ece07a79c95727c8298d1c69c 100644 (file)
@@ -334,7 +334,8 @@ bool trigger_push_test(entity this, entity item)
 {
        // first calculate a typical start point for the jump
        vector org = (this.absmin + this.absmax) * 0.5;
-       org.z = this.absmax.z - PL_MIN_CONST.z - 7;
+       if(!STAT(VQ3COMPAT))
+               org.z = this.absmax.z - PL_MIN_CONST.z - 7;
 
        if (this.target)
        {
index 9b8f04041780fd55f707331540c74ab99b0e8e88..369042b77daac1f2272c01337b53b7cfa9fe295d 100644 (file)
@@ -301,6 +301,11 @@ bool autocvar_sv_slick_applygravity;
 #endif
 REGISTER_STAT(SLICK_APPLYGRAVITY, bool, autocvar_sv_slick_applygravity)
 
+#ifdef SVQC
+bool autocvar_sv_vq3compat;
+#endif
+REGISTER_STAT(VQ3COMPAT, bool, autocvar_sv_vq3compat)
+
 #ifdef SVQC
 #include "physics/movetypes/movetypes.qh"
 float warmup_limit;
index d4997b99a5ad805655c630ff414b78fbbdec194a..4e180f731b2acd7d95efb8e74ba75b091f47f4c8 100644 (file)
@@ -316,7 +316,6 @@ 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 9134f319dd45712e11b097bbc959e5f855e41624..4b9febd221d52af46f8d5717c87c4e5ed7b5cf32 100644 (file)
@@ -483,7 +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 sv_vq3compat 0 "toggle for some compatibility hacks (for VQ3 and CPM map compatibility in mapinfo files)"
 
 set g_movement_highspeed 1 "movement speed modification factor (only changes movement when above maxspeed)"