Skip to content

Commit

Permalink
Fix potential problem with core.get_connected_players()
Browse files Browse the repository at this point in the history
  • Loading branch information
sfan5 committed Feb 25, 2020
1 parent 6be7150 commit e2fc930
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/script/lua_api/l_env.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit e2fc930

Please sign in to comment.