1
0
mirror of https://github.com/minetest/minetest_game.git synced 2024-12-22 23:10:17 +01:00

beds: Use player_api functions instead of default (#2654)

This commit is contained in:
David Leal 2020-04-23 15:19:58 -05:00 committed by GitHub
parent 52c6921cb2
commit 81c5b6b399
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -74,10 +74,10 @@ local function lay_down(player, pos, bed_pos, state, skip)
-- 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})
player:set_look_horizontal(math.random(1, 180) / 100) player:set_look_horizontal(math.random(1, 180) / 100)
default.player_attached[name] = false player_api.player_attached[name] = false
player:set_physics_override(1, 1, 1) player:set_physics_override(1, 1, 1)
hud_flags.wielditem = true hud_flags.wielditem = true
default.player_set_animation(player, "stand" , 30) player_api.set_animation(player, "stand" , 30)
-- lay down -- lay down
else else
@ -99,9 +99,9 @@ local function lay_down(player, pos, bed_pos, state, skip)
} }
player:set_physics_override(0, 0, 0) player:set_physics_override(0, 0, 0)
player:set_pos(p) player:set_pos(p)
default.player_attached[name] = true player_api.player_attached[name] = true
hud_flags.wielditem = false hud_flags.wielditem = false
default.player_set_animation(player, "lay" , 0) player_api.set_animation(player, "lay" , 0)
end end
player:hud_set_flags(hud_flags) player:hud_set_flags(hud_flags)