From 67853cb7da61317662ee1181a70bef9241e55b16 Mon Sep 17 00:00:00 2001 From: BrunoMine Date: Sun, 12 Apr 2020 16:28:12 -0300 Subject: [PATCH] Fix place node on wall --- features/tool.lua | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/features/tool.lua b/features/tool.lua index e212f81..bda9c6d 100644 --- a/features/tool.lua +++ b/features/tool.lua @@ -280,10 +280,13 @@ hardtorch.register_tool = function(torchname, def) if hardtorch.registered_torchs[torchname].nodes_off then itemstack:set_name(hardtorch.registered_torchs[torchname].nodes_off.node) end - if not minetest.item_place(itemstack, placer, pointed_thing) then - return itemstack + + local sucess + itemstack, sucess = minetest.item_place(itemstack, placer, pointed_thing) + if sucess == nil then + return end - + -- Remove item from inventory itemstack:take_item() @@ -407,10 +410,10 @@ hardtorch.register_tool = function(torchname, def) else itemstack:set_name(def.nodes.node_wall or def.nodes.node) end - - itemstack = minetest.item_place(itemstack, placer, pointed_thing, wdir) - - if not itemstack then + + local sucess + itemstack, sucess = minetest.item_place(itemstack, placer, pointed_thing) + if sucess == nil then return end