From a581da90dc5d6973de9f394bce71da9b33b55f13 Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 7 Mar 2020 07:19:25 +1000 Subject: [PATCH] If the player has enough ammo already, don't pick up the weapon when g_weapon_stay is set to 2, fixes unnecessary weapon pickup spam --- qcsrc/common/t_items.qc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qcsrc/common/t_items.qc b/qcsrc/common/t_items.qc index df3bb9b52..bd7885d41 100644 --- a/qcsrc/common/t_items.qc +++ b/qcsrc/common/t_items.qc @@ -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) -- 2.39.2