Fix stairs placement over oddly-shaped nodes (#166)

This commit is contained in:
Oblomov 2020-12-18 17:59:57 +01:00 committed by GitHub
parent cf0f875709
commit 8a14250127
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [Unreleased] ## [Unreleased]
### Fixed
- [Fixed stairs placement over oddly-shaped nodes.](https://github.com/minetest-mods/moreblocks/pull/166)
## [2.1.0] - 2020-12-14 ## [2.1.0] - 2020-12-14
### Added ### Added

View File

@ -51,7 +51,10 @@ stairsplus.rotate_node_aux = function(itemstack, placer, pointed_thing)
-- and in general for sneak placement -- and in general for sneak placement
local face_pos = minetest.pointed_thing_to_face_pos(placer, pointed_thing) local face_pos = minetest.pointed_thing_to_face_pos(placer, pointed_thing)
local face_off = vector.subtract(face_pos, under) local face_off = vector.subtract(face_pos, under)
local wallmounted = minetest.dir_to_wallmounted(face_off)
-- we cannot trust face_off to tell us the correct directionif the
-- under node has a non-standard shape, so use the distance between under and above
local wallmounted = minetest.dir_to_wallmounted(vector.subtract(pointed_thing.above, under))
if same_cat and not aux then if same_cat and not aux then
p2 = under_node.param2 p2 = under_node.param2