fix(progress): prop replication overload (#58)

This commit is contained in:
PotatoFarmer441
2025-11-04 02:35:39 +11:00
committed by GitHub
parent 13a24baee4
commit a2f6b9a9e9
2 changed files with 41 additions and 14 deletions

View File

@@ -0,0 +1,12 @@
local maxProps = GetConvarInt('ox:progressPropLimit', 2)
---@param props ProgressPropProps | ProgressPropProps[] | nil
RegisterNetEvent('ox_lib:progressProps', function(props)
if type(props) == 'table' then
props = #props > maxProps and { table.unpack(props, 1, maxProps) } or props
else
props = nil
end
Player(source).state:set('lib:progressProps', props, true)
end)