From 901ad63e06e82c94a14e38b1204a386266ff4786 Mon Sep 17 00:00:00 2001 From: Michael Biddle <556637+mbiddle@users.noreply.github.com> Date: Fri, 15 Nov 2024 14:20:31 -0800 Subject: [PATCH] Me again. Looks like I wasn't the only person who was unaware of QBCore.Shared.Round. --- client.lua | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/client.lua b/client.lua index f2e8daa..3b2844a 100644 --- a/client.lua +++ b/client.lua @@ -1049,12 +1049,6 @@ CreateThread(function() end end) --- Compass -function round(num, numDecimalPlaces) - local mult = 10 ^ (numDecimalPlaces or 0) - return math.floor(num + 0.5 * mult) -end - local prevBaseplateStats = { nil, nil, nil, nil, nil, nil, nil } local function updateBaseplateHud(data) @@ -1109,9 +1103,9 @@ CreateThread(function() local player = PlayerPedId() local camRot = GetGameplayCamRot(0) if Menu.isCompassFollowChecked then - heading = tostring(round(360.0 - ((camRot.z + 360.0) % 360.0))) + heading = tostring(QBCore.Shared.Round(360.0 - ((camRot.z + 360.0) % 360.0))) else - heading = tostring(round(360.0 - GetEntityHeading(player))) + heading = tostring(QBCore.Shared.Round(360.0 - GetEntityHeading(player))) end if heading == '360' then heading = '0' end if heading ~= lastHeading then