Fix nil error when accessing brasier inventory (#7)
Some checks failed
luacheck / luacheck (push) Has been cancelled
Some checks failed
luacheck / luacheck (push) Has been cancelled
When node timers are not deleted by a map operation, the inventory might no longer be present. This properly skips further logic such cases.
This commit is contained in:
parent
d520cd4cf3
commit
699a379acf
@ -41,6 +41,8 @@ local brasier_burn = function(pos)
|
|||||||
if timer:is_started() and node_above.name == "fire:permanent_flame" then return end
|
if timer:is_started() and node_above.name == "fire:permanent_flame" then return end
|
||||||
|
|
||||||
local inv = minetest.get_inventory({type="node", pos=pos})
|
local inv = minetest.get_inventory({type="node", pos=pos})
|
||||||
|
if not inv then return end -- Stop nodetimer
|
||||||
|
|
||||||
local item = inv:get_stack("fuel", 1)
|
local item = inv:get_stack("fuel", 1)
|
||||||
local fuel_burned = minetest.get_craft_result({method="fuel", width=1, items={item:peek_item(1)}}).time
|
local fuel_burned = minetest.get_craft_result({method="fuel", width=1, items={item:peek_item(1)}}).time
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user