Beds: Fix kick_players_afeter_destruct

This commit is contained in:
Wuzzy 2019-02-20 20:52:06 +01:00
parent 8c672fa3b2
commit 7678a1a95f

@ -20,9 +20,9 @@ local function destruct_bed(pos, is_top)
end end
end end
local function kick_player_after_destruct(pos) local function kick_player_after_destruct(destruct_pos)
for name, _ in pairs(mcl_beds.pos) do for name, player_bed_pos in pairs(mcl_beds.bed_pos) do
if vector.equals(pos, mcl_beds.pos) then if vector.distance(destruct_pos, player_bed_pos) < 0.1 then
local player = minetest.get_player_by_name(name) local player = minetest.get_player_by_name(name)
if player and player:is_player() then if player and player:is_player() then
mcl_beds.kick_player(player) mcl_beds.kick_player(player)