Merge pull request 'Fix kicking players from bed when it's destroyed' (#1671) from marcin-serwin/MineClone2:bed-kick-after-destruct-fix into master

Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/1671
This commit is contained in:
kay27 2021-04-29 07:07:34 +00:00
commit d29c71c69a

View File

@ -88,7 +88,7 @@ local function lay_down(player, pos, bed_pos, state, skip)
end
for _, other_pos in pairs(mcl_beds.bed_pos) do
if vector.distance(bed_pos, other_pos) < 0.1 then
if vector.distance(bed_pos2, other_pos) < 0.1 then
return false, S("This bed is already occupied!")
end
end
@ -170,7 +170,7 @@ local function lay_down(player, pos, bed_pos, state, skip)
mcl_beds.player[name] = 1
mcl_beds.pos[name] = pos
mcl_beds.bed_pos[name] = bed_pos
mcl_beds.bed_pos[name] = bed_pos2
player_in_bed = player_in_bed + 1
-- physics, eye_offset, etc
player:set_eye_offset({x = 0, y = -13, z = 0}, {x = 0, y = 0, z = 0})