fix arccw gun not having ammo when using custom rounds

This commit is contained in:
edshot99 2025-01-14 10:20:31 -06:00
parent 96971879c3
commit 49697b2a50

View File

@ -22,3 +22,15 @@ hook.Add("OnNPCKilled", "edshot_AmmoRestoredOnNPCKill", function(npc, attacker,
end
end
end)
hook.Add("WeaponEquip", "edshot_AmmoRestoredOnEquip", function(weapon, owner)
if owner:IsValid() and !owner:IsNextBot() and !owner:IsNPC() and owner:IsPlayer() then
local weps = attacker:GetWeapons()
for _, wep in ipairs(weps) do
if IsValid(wep) then
wep:SetClip1( wep:GetMaxClip1() )
end
end
end
end)