sneak works in addition to aux1, for inverting pickup-as-group or placing single territory markers

master
capitalthree 1 year ago
parent cbc2d2c1a7
commit 8fb6fcc381
  1. 7
      rules.lua

@ -346,7 +346,9 @@ function lc_liberties.handle_placement(pos)
end end
function lc_liberties.handle_territory_fill(itemstack, placer, pointed_thing) 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 or
(pointed_thing and pointed_thing.under and minetest.get_node(pointed_thing.under).name == "nc_items:stack") (pointed_thing and pointed_thing.under and minetest.get_node(pointed_thing.under).name == "nc_items:stack")
then then
@ -374,7 +376,8 @@ end
function lc_liberties.handle_dig(pos, node, digger) function lc_liberties.handle_dig(pos, node, digger)
cache = {} 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) (minetest.registered_items[node.name].groups.go_territory_marker ~= nil)
then then

Loading…
Cancel
Save