Fix stairs placement over oddly-shaped nodes (#166)
This commit is contained in:
parent
cf0f875709
commit
8a14250127
@ -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
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user