mirror of
https://github.com/minetest/minetest_game.git
synced 2024-12-22 23:10:17 +01:00
Prevent blocking of fuel inventory by fuel replacement (#2895)
This commit is contained in:
parent
1309953da6
commit
02ec133392
@ -176,9 +176,16 @@ local function furnace_node_timer(pos, elapsed)
|
|||||||
-- No valid fuel in fuel list
|
-- No valid fuel in fuel list
|
||||||
fuel_totaltime = 0
|
fuel_totaltime = 0
|
||||||
src_time = 0
|
src_time = 0
|
||||||
|
else
|
||||||
|
-- prevent blocking of fuel inventory (for automatization mods)
|
||||||
|
local is_fuel = minetest.get_craft_result({method = "fuel", width = 1, items = {afterfuel.items[1]:to_string()}})
|
||||||
|
if is_fuel.time == 0 then
|
||||||
|
table.insert(fuel.replacements, afterfuel.items[1])
|
||||||
|
inv:set_stack("fuel", 1, "")
|
||||||
else
|
else
|
||||||
-- Take fuel from fuel list
|
-- Take fuel from fuel list
|
||||||
inv:set_stack("fuel", 1, afterfuel.items[1])
|
inv:set_stack("fuel", 1, afterfuel.items[1])
|
||||||
|
end
|
||||||
-- Put replacements in dst list or drop them on the furnace.
|
-- Put replacements in dst list or drop them on the furnace.
|
||||||
local replacements = fuel.replacements
|
local replacements = fuel.replacements
|
||||||
if replacements[1] then
|
if replacements[1] then
|
||||||
|
Loading…
Reference in New Issue
Block a user