From: Mario Date: Sun, 20 Aug 2017 07:31:56 +0000 (+1000) Subject: Call the explosion mutator hook before setting new owner, so the old owner may be... X-Git-Tag: xonotic-v0.8.5~2519 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e2a8c187bbf0221d6c1ef12d7d66ff3ba1627b6c;p=xonotic%2Fxonotic-data.pk3dir.git Call the explosion mutator hook before setting new owner, so the old owner may be referenced (new one is already known here) --- diff --git a/qcsrc/server/weapons/common.qc b/qcsrc/server/weapons/common.qc index b94b2533f..f69faa03a 100644 --- a/qcsrc/server/weapons/common.qc +++ b/qcsrc/server/weapons/common.qc @@ -84,14 +84,14 @@ void W_PrepareExplosionByDamage(entity this, entity attacker, void(entity this) this.takedamage = DAMAGE_NO; this.event_damage = func_null; + MUTATOR_CALLHOOK(PrepareExplosionByDamage, this, attacker); + if(IS_CLIENT(attacker) && !autocvar_g_projectiles_keep_owner) { this.owner = attacker; this.realowner = attacker; } - MUTATOR_CALLHOOK(PrepareExplosionByDamage, this, attacker); - // do not explode NOW but in the NEXT FRAME! // because recursive calls to RadiusDamage are not allowed this.nextthink = time;