diff --git a/block_league/src/arena_lib/on_entering.lua b/block_league/src/arena_lib/on_entering.lua index fe45045..c11bb82 100644 --- a/block_league/src/arena_lib/on_entering.lua +++ b/block_league/src/arena_lib/on_entering.lua @@ -102,11 +102,13 @@ function init_dmg_table(p_name, players, in_progress) -- se in corso, aggiungo nuovə giocante per chi era già dentro if in_progress then - for pl_name, pl_data in pairs(players) do + for _, pl_data in pairs(players) do pl_data.dmg_received[p_name] = {timestamp = 99999, dmg = 0} - for ent_name, _ in pairs(pl_data.entities) do - pl_data.dmg_received[pl_name .. "@" .. ent_name] = {timestamp = 99999, dmg = 0} + for _, ent_obj in pairs(pl_data.entities) do + if ent_obj:get_luaentity() then -- mi fido 0 + ent_obj:get_luaentity()._dmg_received[p_name] = {timestamp = 99999, dmg = 0} + end end end end