mirror of
https://github.com/mt-mods/unifieddyes.git
synced 2024-11-26 01:13:49 +01:00
respect the shift click convention and fix unreachable if else(if) tree
This commit is contained in:
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
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user