From 978e88bda5b6d1f02187f700630b1a80a46fed07 Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Sat, 11 Mar 2017 21:20:10 -0500 Subject: don't crash if the dye target is an unknown node :P --- init.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/init.lua b/init.lua index 1221a72..a713c45 100644 --- a/init.lua +++ b/init.lua @@ -505,6 +505,8 @@ function unifieddyes.on_use(itemstack, player, pointed_thing) local nodedef = minetest.registered_nodes[node.name] local playername = player:get_player_name() + if not nodedef then return end -- target was an unknown node, just bail out + -- if the node has an on_punch defined, bail out and call that instead, unless "sneak" is pressed. if not player:get_player_control().sneak then local onpunch = nodedef.on_punch(pos, node, player, pointed_thing) -- cgit v1.2.3