From 8fb6fcc3816f76f91619ac760b4fb20406fef877 Mon Sep 17 00:00:00 2001 From: capitalthree Date: Mon, 27 Nov 2023 07:24:04 -0600 Subject: [PATCH] sneak works in addition to aux1, for inverting pickup-as-group or placing single territory markers --- rules.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rules.lua b/rules.lua index 2e7c385..f0febba 100644 --- a/rules.lua +++ b/rules.lua @@ -346,7 +346,9 @@ function lc_liberties.handle_placement(pos) end function lc_liberties.handle_territory_fill(itemstack, placer, pointed_thing) - if (placer.get_player_control and placer:get_player_control().aux1) + 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 @@ -374,7 +376,8 @@ end function lc_liberties.handle_dig(pos, node, digger) cache = {} - if (digger.get_player_control and digger:get_player_control().aux1) + local control = digger.get_player_control and digger:get_player_control() + if (control and (control.aux1 or control.sneak)) ~= (minetest.registered_items[node.name].groups.go_territory_marker ~= nil) then