From 1a05070345a024ff565fbaa342580c05c6412601 Mon Sep 17 00:00:00 2001 From: Samual Date: Tue, 24 May 2011 22:38:36 -0400 Subject: [PATCH] Fix a warning given by setanim since it had no animation information sent to it. --- qcsrc/server/cl_weaponsystem.qc | 13 +++++++------ qcsrc/server/g_subs.qc | 3 +++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/qcsrc/server/cl_weaponsystem.qc b/qcsrc/server/cl_weaponsystem.qc index 8589a8806..9e8865ab9 100644 --- a/qcsrc/server/cl_weaponsystem.qc +++ b/qcsrc/server/cl_weaponsystem.qc @@ -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); + } } }; diff --git a/qcsrc/server/g_subs.qc b/qcsrc/server/g_subs.qc index 22c8931be..c311f3774 100644 --- a/qcsrc/server/g_subs.qc +++ b/qcsrc/server/g_subs.qc @@ -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) -- 2.39.2