mirror of
https://github.com/ND-Framework/ND_Core.git
synced 2026-08-16 21:46:03 +01:00
fix(shared/functions): isreosurcestarted errors
This commit is contained in:
@@ -3,7 +3,8 @@ local startedResources = {}
|
||||
local function stateChanged(resourceName, state)
|
||||
local callbacks = startedResources[resourceName]
|
||||
if not callbacks then return end
|
||||
for _, cb do
|
||||
for i=1, #callbacks do
|
||||
local cb = callbacks[i]
|
||||
cb(state)
|
||||
end
|
||||
end
|
||||
@@ -22,8 +23,7 @@ function NDCore.isResourceStarted(resourceName, cb)
|
||||
if not startedResources[resourceName] then
|
||||
startedResources[resourceName] = {}
|
||||
end
|
||||
local invokingResource = GetInvokingResource()
|
||||
startedResources[resourceName][invokingResource] = cb
|
||||
startedResources[resourceName][#startedResources[resourceName]+1] = cb
|
||||
cb(started)
|
||||
end
|
||||
return started
|
||||
|
||||
Reference in New Issue
Block a user