From: Mario Date: Thu, 27 Nov 2014 05:53:08 +0000 (+1100) Subject: Fix infinite shotgun ammo X-Git-Tag: xonotic-v0.8.0~122^2~28 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c9cbe64c334fbed4d1f1282378b8ea8cfe9dd8d8;p=xonotic%2Fxonotic-data.pk3dir.git Fix infinite shotgun ammo --- diff --git a/qcsrc/common/weapons/w_shotgun.qc b/qcsrc/common/weapons/w_shotgun.qc index 532d563a6..973809bd0 100644 --- a/qcsrc/common/weapons/w_shotgun.qc +++ b/qcsrc/common/weapons/w_shotgun.qc @@ -193,6 +193,7 @@ void W_Shotgun_Attack2(void) float W_Shotgun(float req) { + float ammo_amount; switch(req) { case WR_AIM: @@ -256,9 +257,14 @@ float W_Shotgun(float req) return TRUE; } case WR_CHECKAMMO1: + { + ammo_amount = self.WEP_AMMO(SHOTGUN) >= WEP_CVAR_PRI(shotgun, ammo); + ammo_amount += self.(weapon_load[WEP_SHOTGUN]) >= WEP_CVAR_PRI(shotgun, ammo); + return ammo_amount; + } case WR_CHECKAMMO2: { - // shotgun has infinite ammo + // melee has infinite ammo return TRUE; } case WR_CONFIG: