mirror of
https://github.com/minetest/minetest_game.git
synced 2024-12-22 23:10:17 +01:00
Improve stair placement rotation for bridging (#2979)
Co-authored-by: sfan5 <sfan5@live.de>
This commit is contained in:
parent
e903b1f6d0
commit
aff9c28eed
@ -32,7 +32,13 @@ local function rotate_and_place(itemstack, placer, pointed_thing)
|
|||||||
if placer then
|
if placer then
|
||||||
local placer_pos = placer:get_pos()
|
local placer_pos = placer:get_pos()
|
||||||
if placer_pos then
|
if placer_pos then
|
||||||
param2 = minetest.dir_to_facedir(vector.subtract(p1, placer_pos))
|
local diff = vector.subtract(p1, placer_pos)
|
||||||
|
param2 = minetest.dir_to_facedir(diff)
|
||||||
|
-- The player places a node on the side face of the node he is standing on
|
||||||
|
if p0.y == p1.y and math.abs(diff.x) <= 0.5 and math.abs(diff.z) <= 0.5 and diff.y < 0 then
|
||||||
|
-- reverse node direction
|
||||||
|
param2 = (param2 + 2) % 4
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local finepos = minetest.pointed_thing_to_face_pos(placer, pointed_thing)
|
local finepos = minetest.pointed_thing_to_face_pos(placer, pointed_thing)
|
||||||
|
Loading…
Reference in New Issue
Block a user