feat: further simplify of funcref check

This commit is contained in:
Zerio
2025-01-07 07:40:43 +01:00
parent d08d7bbeba
commit 369f15bd4c
+1 -6
View File
@@ -70,12 +70,7 @@ end
function QBShared.IsFunction(value) function QBShared.IsFunction(value)
if type(value) == 'table' then if type(value) == 'table' then
local success = pcall(function() return value.__cfx_functionReference ~= nil and type(value.__cfx_functionReference) == "string"
-- we just need to check if the table is indexable or not, this will simply return the error "cannot index a funcref"
return value.__cfx_functionReference
end)
return success
end end
return type(value) == 'function' return type(value) == 'function'