Skip to content

Commit

Permalink
Merge pull request #197 from mbiddle/main
Browse files Browse the repository at this point in the history
Me again. Looks like I wasn't the only person who was unaware of QBCore.Shared.Round.
  • Loading branch information
GhzGarage authored Jan 20, 2025
2 parents 32ddf22 + 4324987 commit bfbb8a2
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit bfbb8a2

Please sign in to comment.