]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
animdecide: cancel the weapon fire anim when firing is over
authorRudolf Polzer <divverent@xonotic.org>
Sun, 2 Dec 2012 11:38:20 +0000 (12:38 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Sun, 2 Dec 2012 11:38:20 +0000 (12:38 +0100)
qcsrc/server/cl_weaponsystem.qc

index e2e547a2354b0301ac24f83ae11c281d2a033534..690d9b5511d6d8291e80f44269f17be4efa6561e 100644 (file)
@@ -1046,16 +1046,18 @@ void weapon_thinkf(float fr, float t, void() func)
        self.weapon_think = func;
        //dprint("next ", ftos(self.weapon_nextthink), "\n");
 
-       // The shoot animation looks TERRIBLE without animation blending! Yay for moonwalking while shooting!
-       //anim = self.anim_shoot;
-       if (t)
-       if (!self.crouch) // shoot anim stands up, this looks bad
+       if((fr == WFRAME_FIRE1 || fr == WFRAME_FIRE2) && t)
        {
                if(self.weapon == WEP_SHOTGUN && self.BUTTON_ATCK2)
                        animdecide_setaction(self, ANIMACTION_MELEE, restartanim);
                else
                        animdecide_setaction(self, ANIMACTION_SHOOT, restartanim);
        }
+       else
+       {
+               if(self.anim_upper_action == ANIMACTION_SHOOT || self.anim_upper_action == ANIMACTION_MELEE)
+                       self.anim_upper_action = 0;
+       }
 }
 
 void weapon_boblayer1(float spd, vector org)