mirror of
https://github.com/minetest/minetest_game.git
synced 2024-11-09 17:23:51 +01:00
Allow mods to override animation globalstep
This commit is contained in:
parent
a6f3b89596
commit
f665382017
@ -178,8 +178,8 @@ function minetest.calculate_knockback(player, ...)
|
||||
end
|
||||
|
||||
-- Check each player and apply animations
|
||||
minetest.register_globalstep(function()
|
||||
for _, player in pairs(minetest.get_connected_players()) do
|
||||
function player_api.globalstep()
|
||||
for _, player in ipairs(minetest.get_connected_players()) do
|
||||
local name = player:get_player_name()
|
||||
local player_data = players[name]
|
||||
local model = player_data and models[player_data.model]
|
||||
@ -208,6 +208,11 @@ minetest.register_globalstep(function()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Mods can modify the globalstep by overriding player_api.globalstep
|
||||
minetest.register_globalstep(function(...)
|
||||
player_api.globalstep(players, ...)
|
||||
end)
|
||||
|
||||
for _, api_function in pairs({"get_animation", "set_animation", "set_model", "set_textures"}) do
|
||||
|
Loading…
Reference in New Issue
Block a user