mirror of
https://github.com/qbcore-fivem/qb-core.git
synced 2026-08-28 17:01:16 +00:00
fix: append source id when registering client callback in table to prevent collisions
This commit is contained in:
@@ -449,7 +449,7 @@ function QBCore.Functions.TriggerClientCallback(name, source, ...)
|
|||||||
table.remove(args, 1)
|
table.remove(args, 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
QBCore.ClientCallbacks[name] = {
|
QBCore.ClientCallbacks[name..source] = {
|
||||||
callback = cb,
|
callback = cb,
|
||||||
promise = promise.new()
|
promise = promise.new()
|
||||||
}
|
}
|
||||||
@@ -457,8 +457,8 @@ function QBCore.Functions.TriggerClientCallback(name, source, ...)
|
|||||||
TriggerClientEvent('QBCore:Client:TriggerClientCallback', source, name, table.unpack(args))
|
TriggerClientEvent('QBCore:Client:TriggerClientCallback', source, name, table.unpack(args))
|
||||||
|
|
||||||
if cb == nil then
|
if cb == nil then
|
||||||
Citizen.Await(QBCore.ClientCallbacks[name].promise)
|
Citizen.Await(QBCore.ClientCallbacks[name..source].promise)
|
||||||
return QBCore.ClientCallbacks[name].promise.value
|
return QBCore.ClientCallbacks[name..source].promise.value
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user