Fix stair placement error caused by unexpected param2 values

This commit is contained in:
SmallJoker
2025-07-09 13:06:21 +02:00
parent 1e3a7074ea
commit 35b8b5a240

View File

@ -66,7 +66,10 @@ stairsplus.rotate_node_aux = function(itemstack, placer, pointed_thing)
local wallmounted = minetest.dir_to_wallmounted(vector.subtract(pointed_thing.above, under))
if same_cat and not aux then
p2 = under_node.param2
-- param2 can be in the range [0, 31]. We assume that the stair nodes use the
-- drawtype "facedir". Wrap the value like done in Luanti `src/mapnode.cpp`.
p2 = under_node.param2 % 24
-- flip if placing above or below an upright or upside-down node
-- TODO should we also flip when placing next to a side-mounted node?
if wallmounted < 2 then