mirror of
https://github.com/luanti-org/minetest_game.git
synced 2025-04-30 05:01:41 -04:00
Update beds formspecs when player joins or leaves the game
This commit is contained in:
parent
88ecab34d9
commit
0177fa3a01
1 changed files with 6 additions and 0 deletions
|
@ -254,12 +254,18 @@ if enable_respawn then
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
minetest.register_on_joinplayer(function(player)
|
||||||
|
update_formspecs(false)
|
||||||
|
end)
|
||||||
|
|
||||||
minetest.register_on_leaveplayer(function(player)
|
minetest.register_on_leaveplayer(function(player)
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
lay_down(player, nil, nil, false, true)
|
lay_down(player, nil, nil, false, true)
|
||||||
beds.player[name] = nil
|
beds.player[name] = nil
|
||||||
if check_in_beds() then
|
if check_in_beds() then
|
||||||
schedule_update()
|
schedule_update()
|
||||||
|
else
|
||||||
|
update_formspecs(false)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue