Cache fix on initial load up of server

Issue with cache where it didnt load the default cache (ped, vehicle, seat and weapon) on initial loadup of server

This is a pretty critical bug and should be tested and pushed asap
This commit is contained in:
gononono64 committed 2025-05-02 03:11:06 -05:00
1 parent 01d2f4e1f6
commit df0dedd46c
2 files changed
+9 -13

No files matched your search

+4 -4
View File
@@ -1,7 +1,6 @@
Cache = {}
Cache.Caches = {}
Cache.LoopRunning = false
local Cache = {}
Cache.Caches = Cache.Caches or {}
Cache.LoopRunning = Cache.LoopRunning or false
local max = 5000
local function StartLoop()
@@ -54,6 +53,7 @@ function Cache.Create(name, compare, waitTime)
for _, onChange in pairs(Cache.Caches[name].OnChange) do
onChange(Cache.Caches[name].Value, nil)
end
print("Cache created: " .. name .. " with initial value: " .. tostring(Cache.Caches[name].Value))
return StartLoop()
end