From f4ac338afa57a2a9a055037f78bcb1528c729ec7 Mon Sep 17 00:00:00 2001 From: copygirl Date: Wed, 1 Nov 2023 10:39:32 +0100 Subject: [PATCH] Fix pin duplication bug --- registry.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/registry.lua b/registry.lua index 7c80e40..12955cc 100644 --- a/registry.lua +++ b/registry.lua @@ -18,13 +18,13 @@ minetest.registered_items[""].on_place = function(item_stack, placer, pointed_th local node = minetest.get_node(pos) if registry.is_rotatable(node) then local def = minetest.registered_nodes[node.name] - def.on_rightclick(pos, node, placer, item_stack, pointed_thing) - return -- Skip default behavior. + return def.on_rightclick(pos, node, placer, item_stack, pointed_thing) + -- Skip default behavior. end end end -- Call the default function, so we can still get the "scaling" functionality. - default_on_place(item_stack, placer, pointed_thing, ...) + return default_on_place(item_stack, placer, pointed_thing, ...) end local rotate_node = nc_extended_rotating.rotate.rotate_node @@ -39,7 +39,7 @@ function registry.register_rotatable(name, def, rightclick_filter_func) def.on_rightclick = function(pos, node, clicker, ...) -- If `rightclick_filter_func` is set and returns true, call the default `on_rightclick`. if registry.is_rightclick_filtered(pos, node, clicker, ...) then - default_on_rightclick(pos, node, clicker, ...) + return default_on_rightclick(pos, node, clicker, ...) else if nodecore.protection_test(pos, clicker) then return end local state = nc_extended_rotating.state.get_rotating_state(clicker, pos, node)