territory markers properly defer to all node rightclick actions rather than specialcasing stacks, overridden with sneak

master
capitalthree 1 year ago
parent 8fb6fcc381
commit 02163d903b
  1. 13
      rules.lua

@ -348,13 +348,18 @@ end
function lc_liberties.handle_territory_fill(itemstack, placer, pointed_thing) function lc_liberties.handle_territory_fill(itemstack, placer, pointed_thing)
local control = placer.get_player_control and placer:get_player_control() local control = placer.get_player_control and placer:get_player_control()
if (control and (control.aux1 or control.sneak)) if (control and (control.aux1 or control.sneak)) then
or
(pointed_thing and pointed_thing.under and minetest.get_node(pointed_thing.under).name == "nc_items:stack")
then
return minetest.item_place(itemstack, placer, pointed_thing) return minetest.item_place(itemstack, placer, pointed_thing)
end 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 if pointed_thing and pointed_thing.above then
cache = {} cache = {}

Loading…
Cancel
Save