From 7ba1adae2bbceaad1224cc162f420a9dec2f1dd6 Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Thu, 10 Mar 2016 16:08:42 -0800 Subject: [PATCH] Don't trigger lightning if mods disable auto at init. --- init.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index 0cb6a01..8b160dc 100644 --- a/init.lua +++ b/init.lua @@ -198,7 +198,10 @@ minetest.register_node("lightning:dying_flame", { end, }) - -if lightning.auto then - minetest.after(rng:next(lightning.interval_low, lightning.interval_high), lightning.strike) -end +-- if other mods disable auto lightning during initialization, don't trigger the first lightning. +minetest.after(5, function(dtime) + if lightning.auto then + minetest.after(rng:next(lightning.interval_low, + lightning.interval_high), lightning.strike) + end +end)