diff options
author | Vanessa Ezekowitz <vanessaezekowitz@gmail.com> | 2017-01-30 05:50:02 -0500 |
---|---|---|
committer | Vanessa Ezekowitz <vanessaezekowitz@gmail.com> | 2017-01-30 05:50:02 -0500 |
commit | 935f15c343fbd645cdd8badf392abe9a61504e65 (patch) | |
tree | 412d95605fcab8ed8e00ace1a7e15418b1efc3fa | |
parent | de61a1333b00fede838a588b51c6d36fc471dca2 (diff) | |
download | unifieddyes-935f15c343fbd645cdd8badf392abe9a61504e65.tar unifieddyes-935f15c343fbd645cdd8badf392abe9a61504e65.tar.gz unifieddyes-935f15c343fbd645cdd8badf392abe9a61504e65.tar.bz2 unifieddyes-935f15c343fbd645cdd8badf392abe9a61504e65.tar.xz unifieddyes-935f15c343fbd645cdd8badf392abe9a61504e65.zip |
don't set a custom param2 if the placed node has no facedir/wallmount
-rw-r--r-- | init.lua | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -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 }) |