mirror of
https://github.com/minetest-mods/lightning.git
synced 2024-11-15 23:00:42 +01:00
Allow random striking to be disabled run-time
This commit is contained in:
parent
75ad945534
commit
3c4c9d0e75
11
init.lua
11
init.lua
|
@ -17,6 +17,8 @@ lightning.interval_high = 503
|
|||
lightning.range_h = 100
|
||||
lightning.range_v = 50
|
||||
lightning.size = 100
|
||||
-- disable this to stop lightning mod from striking
|
||||
lightning.auto = true
|
||||
|
||||
local rng = PcgRandom(32321123312123)
|
||||
|
||||
|
@ -42,7 +44,9 @@ end
|
|||
minetest.register_globalstep(revertsky)
|
||||
|
||||
lightning.strike = function()
|
||||
minetest.after(rng:next(lightning.interval_low, lightning.interval_high), lightning.strike)
|
||||
if lightning.auto then
|
||||
minetest.after(rng:next(lightning.interval_low, lightning.interval_high), lightning.strike)
|
||||
fi
|
||||
|
||||
local playerlist = minetest.get_connected_players()
|
||||
local playercount = table.getn(playerlist)
|
||||
|
@ -181,5 +185,6 @@ minetest.register_node("lightning:dying_flame", {
|
|||
})
|
||||
|
||||
|
||||
|
||||
minetest.after(rng:next(lightning.interval_low, lightning.interval_high), lightning.strike)
|
||||
if lightning.auto then
|
||||
minetest.after(rng:next(lightning.interval_low, lightning.interval_high), lightning.strike)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user