diff --git a/data/scripts/globalevents/world_light.lua b/data/scripts/globalevents/world_light.lua index e3cc9d0..213b689 100644 --- a/data/scripts/globalevents/world_light.lua +++ b/data/scripts/globalevents/world_light.lua @@ -24,7 +24,7 @@ local function calculateWorldLightLevel() return math.floor(((worldConfig.dayTime - worldConfig.sunrise) - (worldConfig.dayTime - worldTime)) * lightChange.sunrise + lightConfig.night) elseif worldTime >= worldConfig.sunset and worldTime <= worldConfig.nightTime then - return lightConfig.day - ((worldTime - worldConfig.sunset) * lightChange.sunset) + return math.floor(lightConfig.day - ((worldTime - worldConfig.sunset) * lightChange.sunset)) elseif worldTime >= worldConfig.nightTime or worldTime < worldConfig.sunrise then return lightConfig.night end diff --git a/data/scripts/globalevents/world_time.lua b/data/scripts/globalevents/world_time.lua index 60ce6c4..86349f2 100644 --- a/data/scripts/globalevents/world_time.lua +++ b/data/scripts/globalevents/world_time.lua @@ -8,7 +8,7 @@ function event.onTime(interval) local currentTime = os.time() local sec = os.date("%S", currentTime) local min = os.date("%M", currentTime) - local worldTime = (sec + (min * 60)) / 2.5 + local worldTime = math.floor((sec + (min * 60)) / 2.5) Game.setWorldTime(worldTime) return true end