From: Mario Date: Fri, 6 Mar 2020 21:19:25 +0000 (+1000) Subject: If the player has enough ammo already, don't pick up the weapon when g_weapon_stay... X-Git-Tag: xonotic-v0.8.5~1145^2~5 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a581da90dc5d6973de9f394bce71da9b33b55f13;p=xonotic%2Fxonotic-data.pk3dir.git 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 --- 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)