Oh right, it has to return true

This commit is contained in:
ThePython 2024-03-01 07:54:41 -08:00
parent e3c51c517e
commit bd934c691b
1 changed files with 2 additions and 16 deletions

View File

@ -2,29 +2,15 @@ local function pedestal_action(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
local stack = inv:get_stack("main", 1) local stack = inv:get_stack("main", 1)
if stack:is_empty() then
minetest.log("empty")
minetest.get_node_timer(pos):stop()
return
end
local def = stack:get_definition() local def = stack:get_definition()
if not def then
minetest.log("no def")
minetest.get_node_timer(pos):stop()
return
end
local func = def._exchangeclone_pedestal local func = def._exchangeclone_pedestal
if func then if func then
minetest.log("Running function") minetest.log("Running function")
inv:set_stack("main", 1, func(pos, stack) or stack) inv:set_stack("main", 1, func(pos, stack) or stack)
local new_stack = inv:get_stack("main", 1) local new_stack = inv:get_stack("main", 1)
if not (new_stack:get_definition() and new_stack:get_definition()._exchangeclone_pedestal) then if new_stack:get_definition() and new_stack:get_definition()._exchangeclone_pedestal then
minetest.log("fail 2") return true
minetest.get_node_timer(pos):stop()
end end
else
minetest.log("no func")
minetest.get_node_timer(pos):stop()
end end
end end