From 6709dc40c27476ea82db508629fbb38b5ab98551 Mon Sep 17 00:00:00 2001 From: theFox6 Date: Thu, 17 May 2018 13:55:31 +0200 Subject: [PATCH] fixed crash when weather.type is invalid --- weather/api.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/weather/api.lua b/weather/api.lua index d4ac173..cbaca7d 100644 --- a/weather/api.lua +++ b/weather/api.lua @@ -68,6 +68,7 @@ end function weather_mod.handle_lightning() if not minetest.get_modpath("lightning") then return end local current_downfall = weather_mod.registered_downfalls[weather.type] + if not current_downfall then return end lightning.auto = current_downfall.enable_lightning if current_downfall.enable_lightning and math.random(1,2) == 1 then local time = math.floor(math.random(lightning.interval_low/2,lightning.interval_low))