Skip to content

Commit 533045d

Browse files
SmallJokerCalinou
authored andcommitted
Fix stair placement error caused by unexpected param2 values
1 parent 58baa2b commit 533045d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

stairsplus/common.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ stairsplus.rotate_node_aux = function(itemstack, placer, pointed_thing)
6666
local wallmounted = minetest.dir_to_wallmounted(vector.subtract(pointed_thing.above, under))
6767

6868
if same_cat and not aux then
69-
p2 = under_node.param2
69+
-- param2 can be in the range [0, 31]. We assume that the stair nodes use the
70+
-- drawtype "facedir". Wrap the value like done in Luanti `src/mapnode.cpp`.
71+
p2 = under_node.param2 % 24
72+
7073
-- flip if placing above or below an upright or upside-down node
7174
-- TODO should we also flip when placing next to a side-mounted node?
7275
if wallmounted < 2 then

0 commit comments

Comments
 (0)