From 51e398580462a010c24a9d406f0cabb891c64271 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 16 Sep 2018 04:26:21 +1000 Subject: [PATCH] Add a temporary cvar to mapinfo generation to fix an issue with VQ3 maps --- qcsrc/common/mapinfo.qc | 3 +++ qcsrc/common/mapobjects/trigger/hurt.qc | 4 ++-- qcsrc/server/autocvars.qh | 1 + xonotic-server.cfg | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/qcsrc/common/mapinfo.qc b/qcsrc/common/mapinfo.qc index 0884bc8d7..f002f84b8 100644 --- a/qcsrc/common/mapinfo.qc +++ b/qcsrc/common/mapinfo.qc @@ -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"); diff --git a/qcsrc/common/mapobjects/trigger/hurt.qc b/qcsrc/common/mapobjects/trigger/hurt.qc index f517151b3..5d38783cc 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 + 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 == "") diff --git a/qcsrc/server/autocvars.qh b/qcsrc/server/autocvars.qh index 4e180f731..d4997b99a 100644 --- a/qcsrc/server/autocvars.qh +++ b/qcsrc/server/autocvars.qh @@ -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; diff --git a/xonotic-server.cfg b/xonotic-server.cfg index 92ca3647b..9134f319d 100644 --- a/xonotic-server.cfg +++ b/xonotic-server.cfg @@ -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)" -- 2.39.2