From 878377301f376b21d4d4529da2a5c082f49792fe Mon Sep 17 00:00:00 2001 From: unknown <24964441+wsor4035@users.noreply.github.com> Date: Sun, 29 May 2022 10:29:47 -0400 Subject: [PATCH] respect the shift click convention and fix unreachable if else(if) tree --- airbrush.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/airbrush.lua b/airbrush.lua index 24d41a2..ead27af 100644 --- a/airbrush.lua +++ b/airbrush.lua @@ -490,6 +490,10 @@ minetest.register_tool("unifieddyes:airbrush", { if pos then node = minetest.get_node(pos) end if node then def = minetest.registered_items[node.name] end + if keys.sneak and def and def.on_rightclick then + return def.on_rightclick(pos, node, placer, itemstack, pointed_thing) + end + unifieddyes.player_last_right_clicked[player_name] = {pos = pos, node = node, def = def} if not keys.aux1 then @@ -504,8 +508,6 @@ minetest.register_tool("unifieddyes:airbrush", { else minetest.chat_send_player(player_name, "*** That node is uncolored.") end - elseif def.on_rightclick then - return def.on_rightclick(pos, node, placer, itemstack, pointed_thing) end end })