From b30a601a98fd016eeda5ff0f8546cfa12bf783f1 Mon Sep 17 00:00:00 2001 From: lordhavoc Date: Mon, 21 Jan 2008 20:47:53 +0000 Subject: [PATCH] fix attack_finished timing on first shot of a burst, this mostly affects the machinegun (which would often shoot twice near-instantly and then begin normal firing) git-svn-id: svn://svn.icculus.org/nexuiz/trunk@3216 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/qcsrc/server/cl_weaponsystem.qc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/data/qcsrc/server/cl_weaponsystem.qc b/data/qcsrc/server/cl_weaponsystem.qc index b561b95a6..94c1d9340 100644 --- a/data/qcsrc/server/cl_weaponsystem.qc +++ b/data/qcsrc/server/cl_weaponsystem.qc @@ -428,7 +428,10 @@ float(float secondary, float attacktime) weapon_prepareattack = if (self.weaponentity.state != WS_READY) return FALSE; self.weaponentity.state = WS_INUSE; - ATTACK_FINISHED(self) = max(time, ATTACK_FINISHED(self) + attacktime); + // if the weapon hasn't been firing continuously, reset the timer + if (ATTACK_FINISHED(self) < time - frametime) + ATTACK_FINISHED(self) = time; + ATTACK_FINISHED(self) = ATTACK_FINISHED(self) + attacktime; return TRUE; }; -- 2.39.2