From aa63bdba6a1de5815d6e7ce9040f605d408732c8 Mon Sep 17 00:00:00 2001 From: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Tue, 10 Dec 2024 14:59:30 +0100 Subject: [PATCH] fix: value assigned to variable hour + minute is overwritten --- server-data/resources/[esx]/vSync/client/client.lua | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/server-data/resources/[esx]/vSync/client/client.lua b/server-data/resources/[esx]/vSync/client/client.lua index a84a4cdea..9e3ada46e 100644 --- a/server-data/resources/[esx]/vSync/client/client.lua +++ b/server-data/resources/[esx]/vSync/client/client.lua @@ -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 @@ -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)