From de04fbc06244b1bcc222ddffb1f80435ddbe47cd Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 24 Nov 2017 07:24:13 +0100 Subject: [PATCH] Fix respawn bugs --- mods/ITEMS/mcl_beds/functions.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_beds/functions.lua b/mods/ITEMS/mcl_beds/functions.lua index 365a399f7c..76f2f32576 100644 --- a/mods/ITEMS/mcl_beds/functions.lua +++ b/mods/ITEMS/mcl_beds/functions.lua @@ -186,7 +186,7 @@ function mcl_beds.on_rightclick(pos, player) if not mcl_beds.player[name] then lay_down(player, ppos, pos) if minetest.get_modpath("mcl_spawn") then - mcl_spawn.set_spawn_pos(player:get_pos()) -- save respawn position when entering bed + mcl_spawn.set_spawn_pos(player, player:get_pos()) -- save respawn position when entering bed end else lay_down(player, nil, nil, false) @@ -209,6 +209,11 @@ end -- Callbacks +minetest.register_on_joinplayer(function(player) + if player:get_attribute("mcl_beds:sleeping") == "true" then + player:set_attribute("mcl_beds:sleeping", "false") + end +end) minetest.register_on_leaveplayer(function(player) local name = player:get_player_name()