forked from minetest-mods/playeranim
Corrige avertissement de la variable globale player_api
- Teste l'existence de la variable globale player_api avant de la lire - Ajoute un message de chargement du mod dans le journal "action"
This commit is contained in:
parent
560af7eae5
commit
bb7d0c3057
4
init.lua
4
init.lua
@ -9,7 +9,7 @@ local BONE_POSITION, BONE_ROTATION = (function()
|
|||||||
return dofile(modpath .. "/model.lua")
|
return dofile(modpath .. "/model.lua")
|
||||||
end)()
|
end)()
|
||||||
|
|
||||||
local get_animation = player_api and player_api.get_animation or default.player_get_animation
|
local get_animation = minetest.global_exists("player_api") and player_api.get_animation or default.player_get_animation
|
||||||
if not get_animation then
|
if not get_animation then
|
||||||
error("player_api.get_animation or default.player_get_animation is not found")
|
error("player_api.get_animation or default.player_get_animation is not found")
|
||||||
end
|
end
|
||||||
@ -299,3 +299,5 @@ minetest.register_globalstep(function(dtime)
|
|||||||
animate_player(player, dtime)
|
animate_player(player, dtime)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
minetest.log("action", "[playeranim] loaded.")
|
||||||
|
Loading…
Reference in New Issue
Block a user