From f69f68c7ce14df64ed71e54b8a4fdc8b90147a78 Mon Sep 17 00:00:00 2001 From: BerkieBb <82737367+BerkieBb@users.noreply.github.com> Date: Tue, 11 Jan 2022 13:49:59 +0100 Subject: [PATCH] fix(client/functions): Return right result when with hasitem callback --- client/functions.lua | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/client/functions.lua b/client/functions.lua index b7f1973..87a5887 100644 --- a/client/functions.lua +++ b/client/functions.lua @@ -20,12 +20,8 @@ end function QBCore.Functions.HasItem(item) local p = promise.new() QBCore.Functions.TriggerCallback('QBCore:HasItem', function(result) - if result then - p:resolve(true) - end - p:resolve(false) + p:resolve(result) end, item) - return Citizen.Await(p) end