make players iterator check for validity of players

This commit is contained in:
whosit 2025-04-05 08:38:19 +03:00
parent b036f36762
commit eb718cd729

View File

@ -83,8 +83,12 @@ local function create_shared_environment(player_name)
return core.get_player_by_name(n)
end,
__call = function(_t)
k, v = next(pl, k)
return v
while next(pl, k) do
k, v = next(pl, k)
if v:is_valid() then
return v
end
end
end,
}
)