mirror of
https://github.com/mt-mods/unifieddyes.git
synced 2024-11-22 23:43:45 +01:00
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)
This commit is contained in:
parent
aef03c1932
commit
966166b1b9
6
init.lua
6
init.lua
@ -301,6 +301,8 @@ function unifieddyes.on_rightclick(pos, node, player, stack, pointed_thing, newn
|
|||||||
end
|
end
|
||||||
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
|
end
|
||||||
node.name = newnode
|
node.name = newnode
|
||||||
minetest.swap_node(pos, node)
|
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
|
elseif string.find(minetest.get_node(pos).name, "_grey") and hue ~= 0 then
|
||||||
newnode.name = string.gsub(newnode.name, "_grey", "_"..HUES[hue])
|
newnode.name = string.gsub(newnode.name, "_grey", "_"..HUES[hue])
|
||||||
end
|
end
|
||||||
end
|
|
||||||
newnode.param2 = paletteidx + (minetest.get_node(pos).param2 % 32)
|
newnode.param2 = paletteidx + (minetest.get_node(pos).param2 % 32)
|
||||||
|
else
|
||||||
|
newnode.param2 = paletteidx
|
||||||
|
end
|
||||||
minetest.swap_node(pos, newnode)
|
minetest.swap_node(pos, newnode)
|
||||||
end
|
end
|
||||||
else -- here is where a node is just being placed, not something being colored
|
else -- here is where a node is just being placed, not something being colored
|
||||||
|
Loading…
Reference in New Issue
Block a user