mirror of
https://github.com/minetest-mods/digtron.git
synced 2024-12-22 20:32:22 +01:00
add some safety checks to update_builder_item
This commit is contained in:
parent
b394214ffa
commit
d0ce43e2fe
1
util.lua
1
util.lua
@ -312,6 +312,7 @@ digtron.update_builder_item = function(pos)
|
|||||||
digtron.remove_builder_item(pos)
|
digtron.remove_builder_item(pos)
|
||||||
node_inventory_table.pos = pos
|
node_inventory_table.pos = pos
|
||||||
local inv = minetest.get_inventory(node_inventory_table)
|
local inv = minetest.get_inventory(node_inventory_table)
|
||||||
|
if inv == nil or inv:get_size("main") < 1 then return end
|
||||||
local item_stack = inv:get_stack("main", 1)
|
local item_stack = inv:get_stack("main", 1)
|
||||||
if not item_stack:is_empty() then
|
if not item_stack:is_empty() then
|
||||||
digtron.create_builder_item = item_stack:get_name()
|
digtron.create_builder_item = item_stack:get_name()
|
||||||
|
Loading…
Reference in New Issue
Block a user