From d3a5c8dbb0450a2aee348f32bd6d1e5be8c039ea Mon Sep 17 00:00:00 2001 From: Mircea Kitsune Date: Fri, 11 Feb 2011 23:02:45 +0200 Subject: [PATCH] Merge two voids back again. It makes more sense this way. --- qcsrc/server/cl_weaponsystem.qc | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/qcsrc/server/cl_weaponsystem.qc b/qcsrc/server/cl_weaponsystem.qc index 176ecb7db..0e6867f72 100644 --- a/qcsrc/server/cl_weaponsystem.qc +++ b/qcsrc/server/cl_weaponsystem.qc @@ -1664,7 +1664,6 @@ float W_ReloadCheck() sprint(self, strcat("You don't have enough ammo to reload the ^2", W_Name(self.weapon), "\n")); self.reload_complain = time + 1; } - // switch away if the amount of ammo is not enough to keep using this weapon if not(weapon_action(self.weapon, WR_CHECKAMMO1) + weapon_action(self.weapon, WR_CHECKAMMO2)) { @@ -1686,7 +1685,7 @@ float W_ReloadCheck() return TRUE; } -void W_ReloadEnd() +void W_ReloadedAndReady() { // finish the reloading process, and do the ammo transfer @@ -1714,9 +1713,18 @@ void W_ReloadEnd() w_ready(); } -void W_ReloadStart() +void W_Reload(float sent_ammo_min, float sent_ammo_amount, float sent_time, string sent_sound) { - // begin the reloading process + // set global values to work with + self.reload_ammo_min = sent_ammo_min; + self.reload_ammo_amount = sent_ammo_amount; + self.reload_time = sent_time; + self.reload_sound = sent_sound; + + if(!W_ReloadCheck()) + return; + + // now begin the reloading process sound (self, CHAN_WEAPON2, self.reload_sound, VOL_BASE, ATTN_NORM); @@ -1726,23 +1734,8 @@ void W_ReloadStart() //ATTACK_FINISHED(self) = max(time, ATTACK_FINISHED(self)) + self.reload_time + 1; - weapon_thinkf(WFRAME_RELOAD, self.reload_time, W_ReloadEnd); + weapon_thinkf(WFRAME_RELOAD, self.reload_time, W_ReloadedAndReady); self.old_clip_load = self.clip_load; self.clip_load = -1; -} - -void W_Reload(float sent_ammo_min, float sent_ammo_amount, float sent_time, string sent_sound) -{ - // set global values to work with - self.reload_ammo_min = sent_ammo_min; - self.reload_ammo_amount = sent_ammo_amount; - self.reload_time = sent_time; - self.reload_sound = sent_sound; - - if(!W_ReloadCheck()) - return; - - // now begin the actual reloading - W_ReloadStart(); } \ No newline at end of file -- 2.39.2