From: otta8634 Date: Wed, 12 Feb 2025 10:07:43 +0000 (+0800) Subject: Prevent recursive RadiusDamage call caused by barrels and nades X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=refs%2Fmerge-requests%2F1466%2Fhead;p=xonotic%2Fxonotic-data.pk3dir.git 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. --- 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; }