Add a setting to disable the random fire chance.
This commit is contained in:
parent
01f2b9c89d
commit
bb3774e922
6
init.lua
6
init.lua
|
@ -22,6 +22,8 @@ lightning.auto = true
|
|||
-- range of the skybox highlight and sound effect
|
||||
lightning.effect_range = 500
|
||||
|
||||
local random_fire = minetest.settings:get_bool("lightning_random_fire") ~= false
|
||||
|
||||
local rng = PcgRandom(32321123312123)
|
||||
|
||||
-- table with playername as key and previous skybox as value
|
||||
|
@ -167,7 +169,7 @@ lightning.strike = function(pos)
|
|||
return
|
||||
end
|
||||
-- very rarely, potentially cause a fire
|
||||
if fire and rng:next(1,1000) == 1 then
|
||||
if fire and random_fire and rng:next(1,1000) == 1 then
|
||||
minetest.set_node(pos2, {name = "fire:basic_flame"})
|
||||
else
|
||||
minetest.set_node(pos2, {name = "lightning:dying_flame"})
|
||||
|
@ -232,4 +234,4 @@ minetest.after(5, function()
|
|||
minetest.after(rng:next(lightning.interval_low,
|
||||
lightning.interval_high), lightning.strike)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
[Settings]
|
||||
# By default when fire is enabled lightning has a small chance to start
|
||||
# a fire. This value allows to disable the random fire chance even when
|
||||
# fire is enabled.
|
||||
lightning_random_fire (Enable random fire) bool true
|
Loading…
Reference in New Issue