From 5336f983a975713e00a3d3d91a870573b422592c Mon Sep 17 00:00:00 2001 From: Mircea Kitsune Date: Fri, 21 Jan 2011 18:11:19 +0200 Subject: [PATCH] Make sure we can / need to reload before checking if we have enough ammo to --- qcsrc/server/cl_weaponsystem.qc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/qcsrc/server/cl_weaponsystem.qc b/qcsrc/server/cl_weaponsystem.qc index 1babd2108..faf18b8da 100644 --- a/qcsrc/server/cl_weaponsystem.qc +++ b/qcsrc/server/cl_weaponsystem.qc @@ -1632,6 +1632,11 @@ void W_SetupProjectileVelocity(entity missile, float pSpeed, float spread) float W_ReloadCheck(float ammo_amount) { + entity e; + e = get_weaponinfo(self.weapon); + if (self.ammo_counter >= cvar(strcat("g_balance_", e.netname, "_reload_ammo"))) + return 0; + if(!ammo_amount) // when we get here, ammo_counter must be 0 or -1 { print("cannot reload... not enough ammo\n"); @@ -1640,11 +1645,6 @@ float W_ReloadCheck(float ammo_amount) return 0; } - entity e; - e = get_weaponinfo(self.weapon); - if (self.ammo_counter >= cvar(strcat("g_balance_", e.netname, "_reload_ammo"))) - return 0; - if (self.weaponentity) { if (self.weaponentity.wframe == WFRAME_RELOAD) -- 2.39.2