refactor(init): set cache[key] after triggering onCache

Allow for comparison of new and old values by checking cache[key]
against the value sent as an argument.
This commit is contained in:
Linden
2022-03-15 10:34:22 +00:00
parent e971778b29
commit 62e4fea5ad

View File

@@ -188,11 +188,11 @@ end)
AddEventHandler('ox_lib:updateCache', function(data)
for key, value in pairs(data) do
cache[key] = value
if lib.onCache[key] then
lib.onCache[key](value)
end
cache[key] = value
end
end)