mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-25 12:01:06 +01:00
Ensure fire always ages
This commit is contained in:
parent
5907415762
commit
34b5c1705b
1 changed files with 12 additions and 12 deletions
|
@ -407,16 +407,17 @@ else -- Fire enabled
|
||||||
chance = 12,
|
chance = 12,
|
||||||
catch_up = false,
|
catch_up = false,
|
||||||
action = function(pos)
|
action = function(pos)
|
||||||
local p = get_ignitable(pos)
|
|
||||||
if p then
|
|
||||||
local node = minetest.get_node(pos)
|
local node = minetest.get_node(pos)
|
||||||
local age = node.param2
|
local age = node.param2
|
||||||
|
|
||||||
|
local p = get_ignitable(pos)
|
||||||
|
if p then
|
||||||
-- Spawn new fire with an age based on this node's age
|
-- Spawn new fire with an age based on this node's age
|
||||||
spawn_fire(p, age+math.random(3,7))
|
spawn_fire(p, age+math.random(3,7))
|
||||||
shuffle_table(adjacents)
|
shuffle_table(adjacents)
|
||||||
|
end
|
||||||
|
|
||||||
-- Age the source fire
|
-- Always age the source fire
|
||||||
age = age + math.random(2,5)
|
age = age + math.random(2,5)
|
||||||
node.param2 = age
|
node.param2 = age
|
||||||
if age >= 255 then
|
if age >= 255 then
|
||||||
|
@ -425,7 +426,6 @@ else -- Fire enabled
|
||||||
end
|
end
|
||||||
minetest.set_node(pos, node)
|
minetest.set_node(pos, node)
|
||||||
end
|
end
|
||||||
end
|
|
||||||
})
|
})
|
||||||
|
|
||||||
--lava fire spread
|
--lava fire spread
|
||||||
|
|
Loading…
Reference in a new issue