respect the shift click convention and fix unreachable if else(if) tree

This commit is contained in:
unknown 2022-05-29 10:29:47 -04:00
parent 2af4f1fb98
commit 878377301f

@ -490,6 +490,10 @@ minetest.register_tool("unifieddyes:airbrush", {
if pos then node = minetest.get_node(pos) end if pos then node = minetest.get_node(pos) end
if node then def = minetest.registered_items[node.name] 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} unifieddyes.player_last_right_clicked[player_name] = {pos = pos, node = node, def = def}
if not keys.aux1 then if not keys.aux1 then
@ -504,8 +508,6 @@ minetest.register_tool("unifieddyes:airbrush", {
else else
minetest.chat_send_player(player_name, "*** That node is uncolored.") minetest.chat_send_player(player_name, "*** That node is uncolored.")
end end
elseif def.on_rightclick then
return def.on_rightclick(pos, node, placer, itemstack, pointed_thing)
end end
end end
}) })