Skip to content
Snippets Groups Projects
Commit 0110e018 authored by LoneWolfHT's avatar LoneWolfHT Committed by Lars Müller
Browse files

Fix bug and globalize `players` table

parent 268a8844
No related branches found
No related tags found
No related merge requests found
......@@ -50,9 +50,12 @@ end
-- Player stats and animations
-- model, textures, animation
local players = {}
player_api.players = {}
player_api.player_attached = {}
-- Local for speed.
local players = player_api.players
local function get_player_data(player)
return assert(players[player:get_player_name()])
end
......@@ -211,11 +214,8 @@ function player_api.globalstep()
end
-- Mods can modify the globalstep by overriding player_api.globalstep
-- local for speed
local player_api_globalstep = player_api.globalstep
minetest.register_globalstep(function(...)
player_api_globalstep(players, ...)
player_api.globalstep(...)
end)
for _, api_function in pairs({"get_animation", "set_animation", "set_model", "set_textures"}) do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment