From bc218c991ca11e9fcd51d6dfb1f348ac80e1b74e Mon Sep 17 00:00:00 2001 From: lordhavoc Date: Thu, 12 Mar 2009 12:25:17 +0000 Subject: [PATCH] fixed a bug that caused the campingrifle's reload anim to not play fixed a bug with weapon switches/respawning in qc weapon animation git-svn-id: svn://svn.icculus.org/nexuiz/trunk@6120 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/qcsrc/server/cl_weaponsystem.qc | 18 +++++++++++++++--- data/qcsrc/server/g_world.qc | 2 +- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/data/qcsrc/server/cl_weaponsystem.qc b/data/qcsrc/server/cl_weaponsystem.qc index bef1ca922..cb03225c2 100644 --- a/data/qcsrc/server/cl_weaponsystem.qc +++ b/data/qcsrc/server/cl_weaponsystem.qc @@ -350,8 +350,20 @@ void CL_Weaponentity_Think() else self.model = ""; + // check if an instant weapon switch occurred + if (self.state == WS_READY) + { + self.angles = '0 0 0'; + makevectors(self.angles_x * '-1 0 0' + self.angles_y * '0 1 0' + self.angles_z * '0 0 1'); + setorigin(self, weapon_offset_x * v_forward - weapon_offset_y * v_right + weapon_offset_z * v_up + weapon_adjust); + } // reset animstate now self.wframe = WFRAME_IDLE; + self.weapon_morph0time = 0; + self.weapon_morph1time = 0; + self.weapon_morph2time = 0; + self.weapon_morph3time = 0; + self.weapon_morph4time = 0; setanim(self, self.anim_idle, TRUE, FALSE, TRUE); if(cvar("g_shootfromcenter") || cvar("g_shootfromeye")) @@ -794,10 +806,10 @@ void weapon_thinkf(float fr, float t, void() func) vector of, or, ou; float restartanim; - if (fr == WFRAME_FIRE1 || fr == WFRAME_FIRE2) - restartanim = TRUE; - else + if (fr == WFRAME_IDLE) restartanim = FALSE; + else + restartanim = TRUE; of = v_forward; or = v_right; diff --git a/data/qcsrc/server/g_world.qc b/data/qcsrc/server/g_world.qc index 059d21c45..54d2872ab 100644 --- a/data/qcsrc/server/g_world.qc +++ b/data/qcsrc/server/g_world.qc @@ -384,7 +384,7 @@ void spawnfunc_worldspawn (void) error("Config file mismatch! Please update defaultNexuiz.cfg to match the QuakeC code, and restart the engine!"); if(cvar_string("cvar_check_weapons") != CVAR_CHECK_WEAPONS) - error("Config file mismatch! Please update weapons.cfg and weaponsPro.cfg to match the QuakeC code, and restart the engine!"); + error("Config file mismatch! Please update weapons.cfg and weaponsHavoc.cfg to match the QuakeC code, and restart the engine!"); } compressShortVector_init(); -- 2.39.2