mirror of
https://github.com/minetest-mods/digtron.git
synced 2024-12-22 20:32:22 +01:00
Merge pull request #18 from joejulian/broken_inventory_hack
Create missing tables
This commit is contained in:
commit
9cc5288326
@ -146,6 +146,9 @@ minetest.register_node("digtron:duplicator", {
|
|||||||
-- clear inventories of image's nodes
|
-- clear inventories of image's nodes
|
||||||
for _, node_image in pairs(layout.inventories) do
|
for _, node_image in pairs(layout.inventories) do
|
||||||
local main_inventory = node_image.meta.inventory.main
|
local main_inventory = node_image.meta.inventory.main
|
||||||
|
if type(main_inventory) ~= "table" then
|
||||||
|
main_inventory = {}
|
||||||
|
end
|
||||||
for index, _ in pairs(main_inventory) do
|
for index, _ in pairs(main_inventory) do
|
||||||
main_inventory[index] = ItemStack(nil)
|
main_inventory[index] = ItemStack(nil)
|
||||||
end
|
end
|
||||||
@ -175,4 +178,4 @@ minetest.register_node("digtron:duplicator", {
|
|||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
})
|
})
|
||||||
|
@ -67,6 +67,9 @@ local function eject_items(pos, node, player, eject_even_without_pipeworks)
|
|||||||
local source_index = nil
|
local source_index = nil
|
||||||
local source_stack = nil
|
local source_stack = nil
|
||||||
for _, node_image in pairs(layout.inventories) do
|
for _, node_image in pairs(layout.inventories) do
|
||||||
|
if type(node_image.meta.inventory.main) ~= "table" then
|
||||||
|
node_image.meta.inventory.main = {}
|
||||||
|
end
|
||||||
for index, item_stack in pairs(node_image.meta.inventory.main) do
|
for index, item_stack in pairs(node_image.meta.inventory.main) do
|
||||||
if item_stack:get_count() > 0 and not filter_items[item_stack:get_name()] then
|
if item_stack:get_count() > 0 and not filter_items[item_stack:get_name()] then
|
||||||
source_node = node_image
|
source_node = node_image
|
||||||
|
Loading…
Reference in New Issue
Block a user