]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix a warning when dying in overkill with no attacker set
authorMario <zacjardine@y7mail.com>
Mon, 16 Mar 2015 20:42:44 +0000 (07:42 +1100)
committerMario <zacjardine@y7mail.com>
Mon, 16 Mar 2015 20:42:44 +0000 (07:42 +1100)
qcsrc/server/mutators/mutator_overkill.qc

index 1d151fc3ea980bc13849398e9580a273431329da..6818b456486bf3bec2e43e8cb3868c3d57329eed 100644 (file)
@@ -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;