1
0
Fork 0

Bed occupation fix

This commit is contained in:
kay27 2020-07-27 00:45:53 +04:00 committed by Wuzzy
parent 6eb810339b
commit c78270e70b
1 changed files with 6 additions and 6 deletions

View File

@ -115,13 +115,16 @@ local function lay_down(player, pos, bed_pos, state, skip)
mcl_beds.player[name] = nil mcl_beds.player[name] = nil
player_in_bed = player_in_bed - 1 player_in_bed = player_in_bed - 1
end end
mcl_beds.pos[name] = nil
mcl_beds.bed_pos[name] = nil
if p then
player:set_pos(p)
end
-- skip here to prevent sending player specific changes (used for leaving players) -- skip here to prevent sending player specific changes (used for leaving players)
if skip then if skip then
return false return false
end end
if p then
player:set_pos(p)
end
-- physics, eye_offset, etc -- physics, eye_offset, etc
player:set_eye_offset({x = 0, y = 0, z = 0}, {x = 0, y = 0, z = 0}) player:set_eye_offset({x = 0, y = 0, z = 0}, {x = 0, y = 0, z = 0})
@ -134,8 +137,6 @@ local function lay_down(player, pos, bed_pos, state, skip)
player:get_meta():set_string("mcl_beds:sleeping", "false") player:get_meta():set_string("mcl_beds:sleeping", "false")
hud_flags.wielditem = true hud_flags.wielditem = true
mcl_player.player_set_animation(player, "stand" , 30) mcl_player.player_set_animation(player, "stand" , 30)
mcl_beds.pos[name] = nil
mcl_beds.bed_pos[name] = nil
-- lay down -- lay down
else else
@ -360,7 +361,6 @@ 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)
mcl_beds.player[name] = nil
if check_in_beds() then if check_in_beds() then
minetest.after(5, function() minetest.after(5, function()
if check_in_beds() then if check_in_beds() then