fix placing of vertical logs and objects in sensible_facedir

This commit is contained in:
Jordan Snelling 2018-02-14 17:20:34 +00:00
parent 6f447fa1f8
commit 17ede7c6b1

View File

@ -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 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 if placer:get_pos().y < 0 then
@ -187,10 +187,12 @@ function mcore.sensible_facedir(itemstack, placer, pointed_thing)
else 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 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 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 if deg_to_fdir == 0 then fdir = 0 -- north