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 function stateChanged(resourceName, state)
|
||||||
local callbacks = startedResources[resourceName]
|
local callbacks = startedResources[resourceName]
|
||||||
if not callbacks then return end
|
if not callbacks then return end
|
||||||
for _, cb do
|
for i=1, #callbacks do
|
||||||
|
local cb = callbacks[i]
|
||||||
cb(state)
|
cb(state)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -22,8 +23,7 @@ function NDCore.isResourceStarted(resourceName, cb)
|
|||||||
if not startedResources[resourceName] then
|
if not startedResources[resourceName] then
|
||||||
startedResources[resourceName] = {}
|
startedResources[resourceName] = {}
|
||||||
end
|
end
|
||||||
local invokingResource = GetInvokingResource()
|
startedResources[resourceName][#startedResources[resourceName]+1] = cb
|
||||||
startedResources[resourceName][invokingResource] = cb
|
|
||||||
cb(started)
|
cb(started)
|
||||||
end
|
end
|
||||||
return started
|
return started
|
||||||
|
|||||||
Reference in New Issue
Block a user