From 369f15bd4c1cd6643019d7a74fc60e4338799ee2 Mon Sep 17 00:00:00 2001 From: Zerio Date: Tue, 7 Jan 2025 07:40:43 +0100 Subject: [PATCH] feat: further simplify of funcref check --- shared/main.lua | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/shared/main.lua b/shared/main.lua index 77dc265..2863b35 100644 --- a/shared/main.lua +++ b/shared/main.lua @@ -70,12 +70,7 @@ end function QBShared.IsFunction(value) if type(value) == 'table' then - local success = pcall(function() - -- 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 + return value.__cfx_functionReference ~= nil and type(value.__cfx_functionReference) == "string" end return type(value) == 'function'