function Clock.updateClient(timeStep)
if currentDate then
currentDate.sec = math.floor(currentDate.sec + timeStep)
if currentDate.sec >= 60 then
currentDate.sec = 0
currentDate.min = currentDate.min + 1
if currentDate.min >= 60 then
currentDate.min = 0
currentDate.hours = currentDate.hour + 1
-- TODO: add 12/24hr support
if currentDate.hour >= 24 then
currentDate.hour = 0
end
end
end
currentTime = string.format("%02d:%02d:%02d", currentDate.hour, currentDate.min, currentDate.sec)
end
AllowMoving = MoveUI.AllowedMoving()
end
currentDate.hours = currentDate.hour + 1
Another problem: if you pause the game (ESC in SP) the clock stands still, keeps the time before the pause when you play again....