From 17ede7c6b1d387b21f988b569cd53ee554cb97c7 Mon Sep 17 00:00:00 2001 From: Jordan Snelling Date: Wed, 14 Feb 2018 17:20:34 +0000 Subject: [PATCH] fix placing of vertical logs and objects in sensible_facedir --- mods/core/init.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mods/core/init.lua b/mods/core/init.lua index aea5fff..ba7d02b 100644 --- a/mods/core/init.lua +++ b/mods/core/init.lua @@ -179,7 +179,7 @@ function mcore.sensible_facedir(itemstack, placer, pointed_thing) if px < 2 and pz < 2 then -- if the node is being placed 1 block away from us, then lets place it either upright or upside down - local pY + local pY = 0 if placer:get_pos().y < 0 then @@ -187,10 +187,12 @@ function mcore.sensible_facedir(itemstack, placer, pointed_thing) else - pY = math.abs(placer:get_pos().y + 1.14) -- we measure the y distance by itself as it may not be needed for wall placed blocks. + pY = math.abs(placer:get_pos().y + 2.14) -- we measure the y distance by itself as it may not be needed for wall placed blocks. end + print (pY - math.abs(rpos.y)) + if pY - math.abs(rpos.y) > 1.5 then -- are we being placed on the floor? let's be upright then. if deg_to_fdir == 0 then fdir = 0 -- north