mirror of
https://git.minetest.land/Mineclonia/Mineclonia.git
synced 2024-11-28 09:53:00 +00:00
Fix stuck player if server shuts down during sleep
This commit is contained in:
parent
f18b1bd52a
commit
0cc8962258
1 changed files with 3 additions and 0 deletions
|
@ -318,8 +318,11 @@ end
|
||||||
-- Callbacks
|
-- Callbacks
|
||||||
minetest.register_on_joinplayer(function(player)
|
minetest.register_on_joinplayer(function(player)
|
||||||
if player:get_attribute("mcl_beds:sleeping") == "true" then
|
if player:get_attribute("mcl_beds:sleeping") == "true" then
|
||||||
|
-- Make player awake on joining server
|
||||||
player:set_attribute("mcl_beds:sleeping", "false")
|
player:set_attribute("mcl_beds:sleeping", "false")
|
||||||
end
|
end
|
||||||
|
playerphysics.remove_physics_factor(player, "speed", "mcl_beds:sleeping")
|
||||||
|
playerphysics.remove_physics_factor(player, "jump", "mcl_beds:sleeping")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
minetest.register_on_leaveplayer(function(player)
|
minetest.register_on_leaveplayer(function(player)
|
||||||
|
|
Loading…
Reference in a new issue