Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Me again. Looks like I wasn't the only person who was unaware of QBCore.Shared.Round. #197

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading