I've always had the math all wrong here.

Our spawn pos is already .5 above the ground. We want only
to correct players that fall through the floow. At -0.95 they
can still walk normal, but instead we correct them at -0.45
which almost always hits them.
This commit is contained in:
Auke Kok 2019-01-25 22:46:19 -08:00
parent f547987974
commit 80738b06b7

View File

@ -373,7 +373,7 @@ function boxes.open_box(player, box_id_list)
end end
local p = player:get_pos() local p = player:get_pos()
if p and p.y < spawn_pos.y - 0.45 and boxes.players_in_boxes[name] then if p and p.y < spawn_pos.y - 0.95 and boxes.players_in_boxes[name] then
minetest.log("error", name .. " fell from an entrance lobby") minetest.log("error", name .. " fell from an entrance lobby")
player:set_pos({x = p.x, y = spawn_pos.y + 0.5, z = p.z}) player:set_pos({x = p.x, y = spawn_pos.y + 0.5, z = p.z})
end end