From ae45fe4cca25b7b21d00d894ed72a44de09704dd Mon Sep 17 00:00:00 2001 From: sfan5 Date: Thu, 18 Jun 2020 16:30:34 +0200 Subject: [PATCH] Fix compatibility with (upcoming) Minetest 5.3.0 But note that since bone animation was fixed in 5.3, there is no reason to use this mod anymore. --- init.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/init.lua b/init.lua index 0f1e498..09ce1d6 100644 --- a/init.lua +++ b/init.lua @@ -20,6 +20,17 @@ if not get_animation then error("player_api.get_animation or default.player_get_animation is not found") end +-- stop player_api from messing stuff up (since 5.3) +if minetest.global_exists("player_api") then + for _, v in pairs(player_api.registered_models["character.b3d"].animations) do + v.x = 0 + v.y = 0 + end + minetest.register_on_joinplayer(function(player) + player:set_local_animation(nil, nil, nil, nil, 0) + end) +end + local function get_animation_speed(player) if player:get_player_control().sneak then return ANIMATION_SPEED_SNEAK