From 7678a1a95fefdf742f39bd39ff11aa249ac12ad5 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 20 Feb 2019 20:52:06 +0100 Subject: [PATCH] Beds: Fix kick_players_afeter_destruct --- mods/ITEMS/mcl_beds/api.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mods/ITEMS/mcl_beds/api.lua b/mods/ITEMS/mcl_beds/api.lua index b6f18ea4..4fbbe55e 100644 --- a/mods/ITEMS/mcl_beds/api.lua +++ b/mods/ITEMS/mcl_beds/api.lua @@ -20,9 +20,9 @@ local function destruct_bed(pos, is_top) end end -local function kick_player_after_destruct(pos) - for name, _ in pairs(mcl_beds.pos) do - if vector.equals(pos, mcl_beds.pos) then +local function kick_player_after_destruct(destruct_pos) + for name, player_bed_pos in pairs(mcl_beds.bed_pos) do + if vector.distance(destruct_pos, player_bed_pos) < 0.1 then local player = minetest.get_player_by_name(name) if player and player:is_player() then mcl_beds.kick_player(player)