From 935f15c343fbd645cdd8badf392abe9a61504e65 Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Mon, 30 Jan 2017 05:50:02 -0500 Subject: don't set a custom param2 if the placed node has no facedir/wallmount --- init.lua | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index 600f795..0ed6cb1 100644 --- a/init.lua +++ b/init.lua @@ -281,6 +281,8 @@ function unifieddyes.on_rightclick(pos, node, player, stack, pointed_thing, newn local pos2 = unifieddyes.select_node(pointed_thing) local paletteidx, hue = unifieddyes.getpaletteidx(name, is_color_fdir) + print(dump(paletteidx)) + if paletteidx then local meta = minetest.get_meta(pos) @@ -366,12 +368,16 @@ function unifieddyes.on_rightclick(pos, node, player, stack, pointed_thing, newn minetest.registered_nodes[name] then local placeable_node = minetest.registered_nodes[stack:get_name()] - local yaw = player:get_look_yaw() - local dir = minetest.yaw_to_dir(yaw-1.5) - local fdir = minetest.dir_to_facedir(dir) + local fdir = 0 if is_color_fdir == "wallmounted" then + local yaw = player:get_look_yaw() + local dir = minetest.yaw_to_dir(yaw-1.5) fdir = minetest.dir_to_wallmounted(dir) + elseif is_color_fdir then + local yaw = player:get_look_yaw() + local dir = minetest.yaw_to_dir(yaw-1.5) + fdir = minetest.dir_to_facedir(dir) end minetest.set_node(pos2, { name = placeable_node.name, param2 = fdir }) -- cgit v1.2.3