From e0acae8ed85b87f4802c1297de5e967233715ce0 Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Sun, 10 Apr 2022 12:53:25 +0200 Subject: [PATCH] Workaround for Minetest #12189 --- init.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 785b3bb..1318067 100644 --- a/init.lua +++ b/init.lua @@ -274,7 +274,15 @@ end local function animate_player(player, dtime) - local animation = get_animation(player).animation + local data = get_animation(player) + if not data then + -- Minetest Engine workaround for 5.6.0-dev and older + -- minetest.register_globalstep may call to this function before the player is + -- initialized by minetest.register_on_joinplayer in player_api + return + end + + local animation = data.animation -- Yaw history if animation == "lay" or animation == "sit" then