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)
|
||||
end
|
||||
|
||||
QBCore.ClientCallbacks[name] = {
|
||||
QBCore.ClientCallbacks[name..source] = {
|
||||
callback = cb,
|
||||
promise = promise.new()
|
||||
}
|
||||
@@ -457,8 +457,8 @@ function QBCore.Functions.TriggerClientCallback(name, source, ...)
|
||||
TriggerClientEvent('QBCore:Client:TriggerClientCallback', source, name, table.unpack(args))
|
||||
|
||||
if cb == nil then
|
||||
Citizen.Await(QBCore.ClientCallbacks[name].promise)
|
||||
return QBCore.ClientCallbacks[name].promise.value
|
||||
Citizen.Await(QBCore.ClientCallbacks[name..source].promise)
|
||||
return QBCore.ClientCallbacks[name..source].promise.value
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user