]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix infinite shotgun ammo
authorMario <zacjardine@y7mail.com>
Thu, 27 Nov 2014 05:53:08 +0000 (16:53 +1100)
committerMario <zacjardine@y7mail.com>
Thu, 27 Nov 2014 05:53:08 +0000 (16:53 +1100)
qcsrc/common/weapons/w_shotgun.qc

index 532d563a6acb0652cdc56a485c868c6ee375f4c2..973809bd0f7b075d9ba5d4b93d3f49abfb93e1de 100644 (file)
@@ -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: