]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
If the player has enough ammo already, don't pick up the weapon when g_weapon_stay...
authorMario <mario.mario@y7mail.com>
Fri, 6 Mar 2020 21:19:25 +0000 (07:19 +1000)
committerMario <mario.mario@y7mail.com>
Fri, 6 Mar 2020 21:19:25 +0000 (07:19 +1000)
qcsrc/common/t_items.qc

index df3bb9b521d3ae4a43046513e330fa0cfc138de4..bd7885d41f5273121d7956b968d2b221b2ee7211 100644 (file)
@@ -735,7 +735,11 @@ bool Item_GiveAmmoTo(entity item, entity player, int res_type, float ammomax)
                        return false;
        }
        else if (g_weapon_stay == 2)
+       {
                ammomax = min(amount, ammomax);
+               if(player_amount >= ammomax)
+                       return false;
+       }
        else
                return false;
        if (amount < 0)