Skip to content

Commit

Permalink
Update beds formspecs when player joins or leaves the game
Browse files Browse the repository at this point in the history
  • Loading branch information
Athozus committed Aug 7, 2024
1 parent 88ecab3 commit 0177fa3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mods/beds/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,18 @@ if enable_respawn then
end)
end

minetest.register_on_joinplayer(function(player)
update_formspecs(false)
end)

minetest.register_on_leaveplayer(function(player)
local name = player:get_player_name()
lay_down(player, nil, nil, false, true)
beds.player[name] = nil
if check_in_beds() then
schedule_update()
else
update_formspecs(false)
end
end)

Expand Down

0 comments on commit 0177fa3

Please sign in to comment.