Browse Source

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"
master
sys4-fr 1 year ago
parent
commit
bb7d0c3057
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      init.lua

+ 3
- 1
init.lua View File

@@ -9,7 +9,7 @@ local BONE_POSITION, BONE_ROTATION = (function()
return dofile(modpath .. "/model.lua")
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
error("player_api.get_animation or default.player_get_animation is not found")
end
@@ -299,3 +299,5 @@ minetest.register_globalstep(function(dtime)
animate_player(player, dtime)
end
end)

minetest.log("action", "[playeranim] loaded.")

Loading…
Cancel
Save