From f35fc0f9a859f007e3dfa7cdf40ab3dad5f07801 Mon Sep 17 00:00:00 2001 From: Mircea Kitsune Date: Fri, 11 Feb 2011 22:09:05 +0200 Subject: [PATCH] Do not set ATTACK_FINISHED in reload code any more. This causes annoying delays if eg: You start reloading a weapon, then quickly switch to another weapon and back to it. Reloading is then canceled, but the 2 second reload time is still there, so your weapon is delayed for 2 seconds without reason. --- qcsrc/server/cl_weaponsystem.qc | 9 --------- 1 file changed, 9 deletions(-) diff --git a/qcsrc/server/cl_weaponsystem.qc b/qcsrc/server/cl_weaponsystem.qc index 6e3558e9b..58c0f275e 100644 --- a/qcsrc/server/cl_weaponsystem.qc +++ b/qcsrc/server/cl_weaponsystem.qc @@ -1671,8 +1671,6 @@ float W_ReloadCheck(float ammo_amount, float ammo_shot) void W_ReloadEnd() { - float t; - // now do the ammo transfer self.clip_load = self.old_clip_load; // restore the ammo counter, in case we still had ammo in the weapon before reloading @@ -1690,8 +1688,6 @@ void W_ReloadEnd() } self.weapon_load[self.weapon] = self.clip_load; - t = ATTACK_FINISHED(self) - self.reload_time - 1; - ATTACK_FINISHED(self) = t; w_ready(); } @@ -1704,13 +1700,8 @@ void W_ReloadStart() if(!W_ReloadCheck(self.(self.current_ammo), self.reload_ammo_min)) return; - float t; - sound (self, CHAN_WEAPON2, self.reload_sound, VOL_BASE, ATTN_NORM); - t = max(time, ATTACK_FINISHED(self)) + self.reload_time + 1; - ATTACK_FINISHED(self) = t; - weapon_thinkf(WFRAME_RELOAD, self.reload_time, W_ReloadEnd); self.old_clip_load = self.clip_load; -- 2.39.2