From: Mario Date: Fri, 13 Dec 2013 01:29:40 +0000 (+1100) Subject: Fix shotgun reloading X-Git-Tag: xonotic-v0.8.0~152^2~220 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b248903644a10e3a06ad01b90c2e433c4ba90163;p=xonotic%2Fxonotic-data.pk3dir.git Fix shotgun reloading --- diff --git a/qcsrc/common/weapons/w_shotgun.qc b/qcsrc/common/weapons/w_shotgun.qc index c00d678ec..31adb4a8b 100644 --- a/qcsrc/common/weapons/w_shotgun.qc +++ b/qcsrc/common/weapons/w_shotgun.qc @@ -205,7 +205,7 @@ float w_shotgun(float req) if(WEP_CVAR(shotgun, reload_ammo) && self.clip_load < WEP_CVAR_PRI(shotgun, ammo)) // forced reload { // don't force reload an empty shotgun if its melee attack is active - if (!(WEP_CVAR(shotgun, secondary) && self.ammo_shells < WEP_CVAR_PRI(shotgun, ammo))) + if (!WEP_CVAR(shotgun, secondary)) WEP_ACTION(self.weapon, WR_RELOAD); } else diff --git a/qcsrc/server/weapons/weaponsystem.qc b/qcsrc/server/weapons/weaponsystem.qc index 593919ec0..e5145927d 100644 --- a/qcsrc/server/weapons/weaponsystem.qc +++ b/qcsrc/server/weapons/weaponsystem.qc @@ -839,7 +839,7 @@ void W_ReloadedAndReady() self.clip_load = self.old_clip_load; // restore the ammo counter, in case we still had ammo in the weapon before reloading // if the gun uses no ammo, max out weapon load, else decrease ammo as we increase weapon load - if(!self.reload_ammo_min || self.items & IT_UNLIMITED_WEAPON_AMMO) + if(!self.reload_ammo_min || self.items & IT_UNLIMITED_WEAPON_AMMO || self.current_ammo == ammo_none) self.clip_load = self.reload_ammo_amount; else { @@ -887,6 +887,7 @@ void W_Reload(float sent_ammo_min, string sent_sound) return; // no ammo, so nothing to load + if(self.current_ammo != ammo_none) if(!self.(self.current_ammo) && self.reload_ammo_min) if (!(self.items & IT_UNLIMITED_WEAPON_AMMO)) {