From: Mircea Kitsune Date: Fri, 11 Feb 2011 20:09:05 +0000 (+0200) Subject: Do not set ATTACK_FINISHED in reload code any more. This causes annoying delays if... X-Git-Tag: xonotic-v0.5.0~309^2~7^2~45 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f35fc0f9a859f007e3dfa7cdf40ab3dad5f07801;p=xonotic%2Fxonotic-data.pk3dir.git 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. --- 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;