beds: Use `player_api` functions instead of `default` (#2654)
authorDavid Leal <halfpacho@gmail.com>
Thu, 23 Apr 2020 20:19:58 +0000 (15:19 -0500)
committerGitHub <noreply@github.com>
Thu, 23 Apr 2020 20:19:58 +0000 (22:19 +0200)
mods/beds/functions.lua

index 6ee0474c0e1c1fdf7bb7b5a4e3b53e7b56af414d..019c123af12695f79cc69f0a0fa53d24792a581c 100644 (file)
@@ -74,10 +74,10 @@ local function lay_down(player, pos, bed_pos, state, skip)
                -- physics, eye_offset, etc
                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)
-               default.player_attached[name] = false
+               player_api.player_attached[name] = false
                player:set_physics_override(1, 1, 1)
                hud_flags.wielditem = true
-               default.player_set_animation(player, "stand" , 30)
+               player_api.set_animation(player, "stand" , 30)
 
        -- lay down
        else
@@ -99,9 +99,9 @@ local function lay_down(player, pos, bed_pos, state, skip)
                }
                player:set_physics_override(0, 0, 0)
                player:set_pos(p)
-               default.player_attached[name] = true
+               player_api.player_attached[name] = true
                hud_flags.wielditem = false
-               default.player_set_animation(player, "lay" , 0)
+               player_api.set_animation(player, "lay" , 0)
        end
 
        player:hud_set_flags(hud_flags)