mirror of
https://github.com/minetest-mods/crafting_bench.git
synced 2024-11-24 12:43:44 +01:00
Fix error in LBM caused by mod-placed nodes
This commit is contained in:
parent
b8353d781b
commit
d3108574a2
3
init.lua
3
init.lua
@ -269,7 +269,8 @@ minetest.register_lbm({
|
|||||||
action = function(pos, node)
|
action = function(pos, node)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
for i, item in ipairs(inv:get_list("rec")) do
|
-- `get_list` may return `nil` when the node was placed without calling `on_construct`
|
||||||
|
for i, item in ipairs(inv:get_list("rec") or {}) do
|
||||||
-- Limit to stack size 1 (or keep empty)
|
-- Limit to stack size 1 (or keep empty)
|
||||||
inv:set_stack("rec", i, item:peek_item())
|
inv:set_stack("rec", i, item:peek_item())
|
||||||
local leftover = inv:add_item("dst", item)
|
local leftover = inv:add_item("dst", item)
|
||||||
|
Loading…
Reference in New Issue
Block a user