diff --git a/mods/ITEMS/mcl_beds/functions.lua b/mods/ITEMS/mcl_beds/functions.lua index 6f4a31380f..8b1b82dfcb 100644 --- a/mods/ITEMS/mcl_beds/functions.lua +++ b/mods/ITEMS/mcl_beds/functions.lua @@ -359,6 +359,7 @@ end) minetest.register_on_leaveplayer(function(player) local players = minetest.get_connected_players() + local name = player:get_player_name() for n, player in ipairs(players) do if player:get_player_name() == name then players[n] = nil