From 6fd7dd2713410e35ce3c3757470dea3a9e69bde2 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 16 Sep 2018 05:14:13 +1000 Subject: [PATCH] Rename the temporary cvar to be a bit more generic in relation to VQ3 compatibility --- qcsrc/common/mapinfo.qc | 2 +- qcsrc/common/mapobjects/trigger/hurt.qc | 4 ++-- qcsrc/common/mapobjects/trigger/hurt.qh | 2 ++ qcsrc/common/mapobjects/trigger/jumppads.qc | 3 ++- qcsrc/common/stats.qh | 5 +++++ qcsrc/server/autocvars.qh | 1 - xonotic-server.cfg | 2 +- 7 files changed, 13 insertions(+), 6 deletions(-) diff --git a/qcsrc/common/mapinfo.qc b/qcsrc/common/mapinfo.qc index f002f84b8..859ec51d5 100644 --- a/qcsrc/common/mapinfo.qc +++ b/qcsrc/common/mapinfo.qc @@ -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"); diff --git a/qcsrc/common/mapobjects/trigger/hurt.qc b/qcsrc/common/mapobjects/trigger/hurt.qc index 5d38783cc..a19c86415 100644 --- a/qcsrc/common/mapobjects/trigger/hurt.qc +++ b/qcsrc/common/mapobjects/trigger/hurt.qc @@ -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 == "") diff --git a/qcsrc/common/mapobjects/trigger/hurt.qh b/qcsrc/common/mapobjects/trigger/hurt.qh index 6f70f09be..e992154aa 100644 --- a/qcsrc/common/mapobjects/trigger/hurt.qh +++ b/qcsrc/common/mapobjects/trigger/hurt.qh @@ -1 +1,3 @@ #pragma once + +const int HURT_SLOW = BIT(4); diff --git a/qcsrc/common/mapobjects/trigger/jumppads.qc b/qcsrc/common/mapobjects/trigger/jumppads.qc index 5ffdf2d10..b32b4d262 100644 --- a/qcsrc/common/mapobjects/trigger/jumppads.qc +++ b/qcsrc/common/mapobjects/trigger/jumppads.qc @@ -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) { diff --git a/qcsrc/common/stats.qh b/qcsrc/common/stats.qh index 9b8f04041..369042b77 100644 --- a/qcsrc/common/stats.qh +++ b/qcsrc/common/stats.qh @@ -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; diff --git a/qcsrc/server/autocvars.qh b/qcsrc/server/autocvars.qh index d4997b99a..4e180f731 100644 --- a/qcsrc/server/autocvars.qh +++ b/qcsrc/server/autocvars.qh @@ -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; diff --git a/xonotic-server.cfg b/xonotic-server.cfg index 9134f319d..4b9febd22 100644 --- a/xonotic-server.cfg +++ b/xonotic-server.cfg @@ -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)" -- 2.39.2