]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix a warning given by setanim since it had no animation information sent to it.
authorSamual <samual@xonotic.org>
Wed, 25 May 2011 02:38:36 +0000 (22:38 -0400)
committerSamual <samual@xonotic.org>
Wed, 25 May 2011 02:38:36 +0000 (22:38 -0400)
qcsrc/server/cl_weaponsystem.qc
qcsrc/server/g_subs.qc

index 8589a88067791c48bea0d5e2e4133e4edbe658db..9e8865ab94e42320eec9056230e1047e652ab3fb 100644 (file)
@@ -1257,18 +1257,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)