fixed crash when weather.type is invalid

This commit is contained in:
theFox6 2018-05-17 13:55:31 +02:00
parent 0c60ce470f
commit 6709dc40c2
1 changed files with 1 additions and 0 deletions

View File

@ -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))