math.pi,
}
-local wall_dir_change = {
- [0] = 2,
- 2,
- 5,
- 4,
- 2,
- 3,
-}
-
signs_lib.fdir_to_back = {
{ 0, -1 },
{ -1, 0 },
{ 1, 0 },
}
+signs_lib.rotate_facedir = {
+ [0] = 1,
+ [1] = 6,
+ [2] = 3,
+ [3] = 0,
+ [4] = 2,
+ [5] = 6,
+ [6] = 4
+}
+
+signs_lib.rotate_walldir = {
+ [0] = 1,
+ [1] = 5,
+ [2] = 0,
+ [3] = 4,
+ [4] = 2,
+ [5] = 3
+}
+
-- Initialize character texture cache
local ctexcache = {}
if mode ~= screwdriver.ROTATE_FACE or string.match(node.name, "_onpole") then
return false
end
- minetest.swap_node(pos, { name = node.name, param2 = wall_dir_change[node.param2 % 6] })
+
+ local newparam2 = signs_lib.rotate_walldir[node.param2] or 0
+
+ minetest.swap_node(pos, { name = node.name, param2 = newparam2 })
for _, v in ipairs(minetest.get_objects_inside_radius(pos, 0.5)) do
local e = v:get_luaentity()
if e and e.name == "signs_lib:text" then
return false
end
- local newparam2 = node.param2 + 1
- if newparam2 > 3 then newparam2 = 0 end
+ local newparam2 = signs_lib.rotate_facedir[node.param2] or 0
minetest.swap_node(pos, { name = node.name, param2 = newparam2 })
for _, v in ipairs(minetest.get_objects_inside_radius(pos, 0.5)) do