From b2e98825d8dd17e032956cae3eed31fb12a8e57b Mon Sep 17 00:00:00 2001 From: otta8634 Date: Wed, 12 Feb 2025 18:07:43 +0800 Subject: [PATCH] Prevent recursive RadiusDamage call caused by barrels and nades When exploding a barrel, any nearby nades that cause radius damage (e.g. the explosion of the normal nade, explosion of the monster nade, etc.) would also explode, in the same frame, thus calling RadiusDamage recursively. Fixed this bug by delaying the nade's radius damage in the same way that radius damage of a weapon projectile (like mortar) is delayed when it's damaged & destroyed, with W_PrepareExplosionByDamage. Bug discovered by myself, fix suggested by Mario, big thanks as always. --- qcsrc/common/mutators/mutator/nades/sv_nades.qc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qcsrc/common/mutators/mutator/nades/sv_nades.qc b/qcsrc/common/mutators/mutator/nades/sv_nades.qc index 0ca068264..bd5249943 100644 --- a/qcsrc/common/mutators/mutator/nades/sv_nades.qc +++ b/qcsrc/common/mutators/mutator/nades/sv_nades.qc @@ -243,7 +243,7 @@ void nade_damage(entity this, entity inflictor, entity attacker, float damage, i if(ITEM_DAMAGE_NEEDKILL(deathtype)) { this.takedamage = DAMAGE_NO; - nade_boom(this); + W_PrepareExplosionByDamage(this, attacker, nade_boom); return; } -- 2.39.5