summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-01-28 18:19:07 -0500
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-01-28 18:19:58 -0500
commit966166b1b9c5c7abae65a6ec66d5d99d4f4703bc (patch)
tree8ffcc27c80929983b0899c07d6ca497ec37cd06d
parentaef03c1932e77291bfab153ee041164e17ecdc43 (diff)
downloadunifieddyes-966166b1b9c5c7abae65a6ec66d5d99d4f4703bc.tar
unifieddyes-966166b1b9c5c7abae65a6ec66d5d99d4f4703bc.tar.gz
unifieddyes-966166b1b9c5c7abae65a6ec66d5d99d4f4703bc.tar.bz2
unifieddyes-966166b1b9c5c7abae65a6ec66d5d99d4f4703bc.tar.xz
unifieddyes-966166b1b9c5c7abae65a6ec66d5d99d4f4703bc.zip
only crop the palleteidx if param2 is colorfacedir
(prevent a potential bug later: some day, maybe there will be more than 89 colors in UD)
-rw-r--r--init.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/init.lua b/init.lua
index f802968..70e3b57 100644
--- a/init.lua
+++ b/init.lua
@@ -300,7 +300,9 @@ function unifieddyes.on_rightclick(pos, node, player, stack, pointed_thing, newn
newnode = string.gsub(newnode, "_grey", "_"..HUES[hue])
end
end
- node.param2 = paletteidx + (minetest.get_node(pos).param2 % 32)
+ node.param2 = paletteidx + (minetest.get_node(pos).param2 % 32)
+ else
+ node.param2 = paletteidx
end
node.name = newnode
minetest.swap_node(pos, node)
@@ -316,8 +318,10 @@ function unifieddyes.on_rightclick(pos, node, player, stack, pointed_thing, newn
elseif string.find(minetest.get_node(pos).name, "_grey") and hue ~= 0 then
newnode.name = string.gsub(newnode.name, "_grey", "_"..HUES[hue])
end
+ newnode.param2 = paletteidx + (minetest.get_node(pos).param2 % 32)
+ else
+ newnode.param2 = paletteidx
end
- newnode.param2 = paletteidx + (minetest.get_node(pos).param2 % 32)
minetest.swap_node(pos, newnode)
end
else -- here is where a node is just being placed, not something being colored