]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote-tracking branch 'origin/samual/fix_anim_divisionbyzero'
authorRudolf Polzer <divverent@xonotic.org>
Fri, 27 May 2011 18:48:59 +0000 (20:48 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Fri, 27 May 2011 18:48:59 +0000 (20:48 +0200)
qcsrc/server/cl_weaponsystem.qc
qcsrc/server/g_subs.qc

index f5fc4a33aab3f42c8ba22d5c9702d1bf95da2813..15894f6df0bc009f2c727f49b15bd2c252580806 100644 (file)
@@ -1260,18 +1260,19 @@ 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!
+       // The shoot animation looks TERRIBLE without animation blending! Yay for moonwalking while shooting!
+       //anim = self.anim_shoot;
        if (restartanim)
        if (t)
        if (!self.crouch) // shoot anim stands up, this looks bad
        {
-               local vector anim;
+               vector anim;
                if(self.weapon == WEP_SHOTGUN && self.BUTTON_ATCK2)
+               {
                        anim = self.anim_melee;
-               /*else
-                       anim = self.anim_shoot;*/
-               anim_z = anim_y / (t + sys_frametime);
-               setanim(self, anim, FALSE, TRUE, TRUE);
+                       anim_z = anim_y / (t + sys_frametime);
+                       setanim(self, anim, FALSE, TRUE, TRUE);
+               }
        }
 };
 
index 22c8931bef8813bc43536ab950b281b1a7def223..c311f3774f45f59c7ad934e6b5992e673c1b4f54 100644 (file)
@@ -16,6 +16,9 @@ void spawnfunc_info_null (void)
 
 void setanim(entity e, vector anim, float looping, float override, float restart)
 {
+       if (!anim)
+               return; // no animation was given to us! We can't use this. 
+               
        if (anim_x == e.animstate_startframe)
        if (anim_y == e.animstate_numframes)
        if (anim_z == e.animstate_framerate)