forked from your-land-mirror/cmd_eval
make players
iterator check for validity of players
This commit is contained in:
parent
b036f36762
commit
eb718cd729
8
init.lua
8
init.lua
@ -83,8 +83,12 @@ local function create_shared_environment(player_name)
|
|||||||
return core.get_player_by_name(n)
|
return core.get_player_by_name(n)
|
||||||
end,
|
end,
|
||||||
__call = function(_t)
|
__call = function(_t)
|
||||||
k, v = next(pl, k)
|
while next(pl, k) do
|
||||||
return v
|
k, v = next(pl, k)
|
||||||
|
if v:is_valid() then
|
||||||
|
return v
|
||||||
|
end
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user