forked from minetest-mods/playeranim
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.
This commit is contained in:
11
init.lua
11
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
|
||||
|
Reference in New Issue
Block a user