mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Fix potential problem with core.get_connected_players()
This commit is contained in:
parent
6be7150cd5
commit
e2fc93022b
1 changed files with 2 additions and 0 deletions
|
@ -648,6 +648,8 @@ int ModApiEnvMod::l_get_connected_players(lua_State *L)
|
|||
lua_createtable(L, env->getPlayerCount(), 0);
|
||||
u32 i = 0;
|
||||
for (RemotePlayer *player : env->getPlayers()) {
|
||||
if (player->getPeerId() == PEER_ID_INEXISTENT)
|
||||
continue;
|
||||
PlayerSAO *sao = player->getPlayerSAO();
|
||||
if (sao) {
|
||||
getScriptApiBase(L)->objectrefGetOrCreate(L, sao);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue