From 02163d903b444ce010c9779df040d0cc2cd1b131 Mon Sep 17 00:00:00 2001 From: capitalthree Date: Mon, 27 Nov 2023 07:53:35 -0600 Subject: [PATCH] territory markers properly defer to all node rightclick actions rather than specialcasing stacks, overridden with sneak --- rules.lua | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/rules.lua b/rules.lua index f0febba..92392c7 100644 --- a/rules.lua +++ b/rules.lua @@ -348,13 +348,18 @@ end function lc_liberties.handle_territory_fill(itemstack, placer, pointed_thing) local control = placer.get_player_control and placer:get_player_control() - if (control and (control.aux1 or control.sneak)) - or - (pointed_thing and pointed_thing.under and minetest.get_node(pointed_thing.under).name == "nc_items:stack") - then + if (control and (control.aux1 or control.sneak)) then return minetest.item_place(itemstack, placer, pointed_thing) end + if (pointed_thing and pointed_thing.under) then + local under = minetest.get_node(pointed_thing.under) + local override_rightclick = minetest.registered_nodes[under.name].on_rightclick + if override_rightclick then + return override_rightclick(pointed_thing.under, under, placer, itemstack, pointed_thing) + end + end + if pointed_thing and pointed_thing.above then cache = {}