From: Mario Date: Mon, 16 Mar 2015 20:42:44 +0000 (+1100) Subject: Fix a warning when dying in overkill with no attacker set X-Git-Tag: xonotic-v0.8.1~103 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7ab9ba572f4efd91a0b5af0b5a0977b38c1ea034;p=xonotic%2Fxonotic-data.pk3dir.git Fix a warning when dying in overkill with no attacker set --- diff --git a/qcsrc/server/mutators/mutator_overkill.qc b/qcsrc/server/mutators/mutator_overkill.qc index 1d151fc3e..6818b4564 100644 --- a/qcsrc/server/mutators/mutator_overkill.qc +++ b/qcsrc/server/mutators/mutator_overkill.qc @@ -64,6 +64,7 @@ MUTATOR_HOOKFUNCTION(ok_PlayerDamage_SplitHealthArmor) MUTATOR_HOOKFUNCTION(ok_PlayerDies) { entity oldself = self; + entity targ = ((frag_attacker) ? frag_attacker : frag_target); if(self.flags & FL_MONSTER) { @@ -80,7 +81,7 @@ MUTATOR_HOOKFUNCTION(ok_PlayerDies) self.gravity = 1; self.reset = SUB_Remove; setorigin(self, frag_target.origin + '0 0 32'); - self.velocity = '0 0 200' + normalize(frag_attacker.origin - self.origin) * 500; + self.velocity = '0 0 200' + normalize(targ.origin - self.origin) * 500; self.classname = "droppedweapon"; // hax SUB_SetFade(self, time + 5, 1); self = oldself;