Skip to content

Commit

Permalink
fix: value assigned to variable hour + minute is overwritten
Browse files Browse the repository at this point in the history
  • Loading branch information
bitpredator committed Dec 10, 2024
1 parent 01dc476 commit aa63bdb
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions server-data/resources/[esx]/vSync/client/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ AddEventHandler("vSync:updateTime", function(base, offset, freeze)
end)

Citizen.CreateThread(function()
local hour = 0
local minute = 0
while true do
Citizen.Wait(0)
local newBaseTime = baseTime
Expand All @@ -57,8 +55,8 @@ Citizen.CreateThread(function()
timeOffset = timeOffset + baseTime - newBaseTime
end
baseTime = newBaseTime
hour = math.floor(((baseTime + timeOffset) / 60) % 24)
minute = math.floor((baseTime + timeOffset) % 60)
local hour = math.floor(((baseTime + timeOffset) / 60) % 24)
local minute = math.floor((baseTime + timeOffset) % 60)
NetworkOverrideClockTime(hour, minute, 0)
end
end)
Expand Down

0 comments on commit aa63bdb

Please sign in to comment.