]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Make it work
authorMario <zacjardine@y7mail.com>
Tue, 16 Dec 2014 22:42:13 +0000 (09:42 +1100)
committerMario <zacjardine@y7mail.com>
Tue, 16 Dec 2014 22:42:13 +0000 (09:42 +1100)
qcsrc/server/mutators/mutator_overkill.qc

index ced2e71061ef5f1cb38b9a09ea3348b7faece5df..8beb5cb15e7393dc124df73a076a9c4a1f3e228b 100644 (file)
@@ -91,8 +91,6 @@ MUTATOR_HOOKFUNCTION(ok_PlayerDies)
                other = world;
        }
 
-       self.ok_lastwep = self.weapon;
-       self.ok_deathloc = self.origin;
        self = spawn();
        self.ok_item = TRUE;
        self.noalign = TRUE;
@@ -107,6 +105,8 @@ MUTATOR_HOOKFUNCTION(ok_PlayerDies)
        SUB_SetFade(self, time + 5, 1);
        self = oldself;
 
+       self.ok_lastwep = self.switchweapon;
+
        return FALSE;
 }
 
@@ -142,6 +142,12 @@ MUTATOR_HOOKFUNCTION(ok_PlayerPreThink)
        if(self.deadflag != DEAD_NO || !IS_PLAYER(self) || self.frozen)
                return FALSE;
 
+       if(self.ok_lastwep)
+       {
+               self.switchweapon = self.ok_lastwep;
+               self.ok_lastwep = 0;
+       }
+
        ok_IncreaseCharge(self, self.weapon);
 
        if(self.BUTTON_ATCK2)
@@ -206,9 +212,6 @@ MUTATOR_HOOKFUNCTION(ok_PlayerSpawn)
                
        self.ok_pauseregen_finished = time + 2;
 
-       self.switchweapon = self.ok_lastwep;
-       self.ok_lastwep = 0;
-
        return FALSE;
 }