From d203762b73db0d8d8111c5805b8d85d387736965 Mon Sep 17 00:00:00 2001 From: Zerio Date: Sat, 25 May 2024 21:10:01 +0000 Subject: [PATCH] fix: lint issues --- client/functions.lua | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/client/functions.lua b/client/functions.lua index 4b4bda1..3224b0d 100644 --- a/client/functions.lua +++ b/client/functions.lua @@ -43,16 +43,13 @@ end function QBCore.Functions.LookAtEntity(entity, timeout, speed) local involved = GetInvokingResource() if not DoesEntityExist(entity) then - turnPromise:reject(involved .. ' :^1 Entity does not exist') - return turnPromise.value + return involved .. ' :^1 Entity does not exist' end - if not type(entity) == 'number' then - turnPromise:reject(involved .. ' :^1 Entity must be a number') - return turnPromise.value + if type(entity) ~= 'number' then + return involved .. ' :^1 Entity must be a number' end - if not type(speed) == 'number' then - turnPromise:reject(involved .. ' :^1 Speed must be a number') - return turnPromise.value + if type(speed) ~= 'number' then + return involved .. ' :^1 Speed must be a number' end if speed > 5.0 then speed = 5.0 end if timeout > 5000 then timeout = 5000 end @@ -62,7 +59,7 @@ function QBCore.Functions.LookAtEntity(entity, timeout, speed) local dx = targetPos.x - playerPos.x local dy = targetPos.y - playerPos.y local targetHeading = GetHeadingFromVector_2d(dx, dy) - local turnSpeed = speed + local turnSpeed = nil local startTimeout = GetGameTimer() while true do local currentHeading = GetEntityHeading(ped)