From 29ec26a4c851d76e4a2ca21949bff94fe37eeccd Mon Sep 17 00:00:00 2001 From: auouymous Date: Thu, 3 Dec 2020 19:12:41 -0700 Subject: Prevent unauthorized players from toggling blinky plant. --- mesecons_blinkyplant/init.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mesecons_blinkyplant/init.lua b/mesecons_blinkyplant/init.lua index 14a274f..3bad6a7 100644 --- a/mesecons_blinkyplant/init.lua +++ b/mesecons_blinkyplant/init.lua @@ -32,7 +32,13 @@ mesecon.register_node("mesecons_blinkyplant:blinky_plant", { fixed = {-0.3, -0.5, -0.3, 0.3, -0.5+0.7, 0.3}, }, on_timer = on_timer, - on_rightclick = toggle_timer, + on_rightclick = function(pos, node, clicker) + if minetest.is_protected(pos, clicker and clicker:get_player_name()) then + return + end + + toggle_timer(pos) + end, on_construct = toggle_timer },{ tiles = {"jeija_blinky_plant_off.png"}, -- cgit v1.2.3