Log warning if initialization fails and validate armor.def for UI

This commit is contained in:
stujones11
2017-04-11 20:42:58 +01:00
parent 9ffcc19fd7
commit b45fbd0f2a
2 changed files with 17 additions and 10 deletions

View File

@ -239,9 +239,13 @@ minetest.register_globalstep(function(dtime)
timer = timer + dtime
if timer > armor.config.init_delay then
for i, con in pairs(pending_players) do
local remove = armor:init_player_armor(con[1]) == true
con[2] = con[2] + 1
if con[2] > armor.config.init_times or
armor:init_player_armor(con[1]) == true then
if con[2] > armor.config.init_times then
minetest.log("warning", "3d_armor: Failed to initialize player")
remove = true
end
if remove == true then
table.remove(pending_players, i)
end
end