From: bones_was_here <bones_was_here@xonotic.au>
Date: Tue, 27 Dec 2022 16:07:36 +0000 (+1000)
Subject: trigger_hurt q3compat: always damage player at 20hz in "fast" mode
X-Git-Tag: xonotic-v0.8.6~240
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c9c3b30b8d55da2488809545ca7220736dfec9b7;p=xonotic%2Fxonotic-data.pk3dir.git

trigger_hurt q3compat: always damage player at 20hz in "fast" mode

Although Q3A and Q3TA damage the player at the ticrate, CPMA and DeFRaG
hard-code trigger_hurt to 20hz (matching Q3A/Q3TA default ticrate) to
make gameplay consistent across all ticrates.

On higher ticrate servers, this fixes the torches on dfwc04-3, the lava
on ct3dm5, etc.
---

diff --git a/qcsrc/common/mapobjects/trigger/hurt.qc b/qcsrc/common/mapobjects/trigger/hurt.qc
index 20c08feb1..3ab2433ad 100644
--- a/qcsrc/common/mapobjects/trigger/hurt.qc
+++ b/qcsrc/common/mapobjects/trigger/hurt.qc
@@ -23,7 +23,7 @@ void trigger_hurt_touch(entity this, entity toucher)
 	// only do the EXACTTRIGGER_TOUCH checks when really needed (saves some cpu)
 	if (toucher.iscreature)
 	{
-		if (time >= toucher.triggerhurttime + ((q3compat && !(this.spawnflags & HURT_SLOW)) ? autocvar_sys_ticrate : 1))
+		if (time >= toucher.triggerhurttime + (q3compat && !(this.spawnflags & HURT_SLOW) ? 0.05 : 1))
 		{
 			EXACTTRIGGER_TOUCH(this, toucher);
 			toucher.triggerhurttime = time;