diff options
author | sfan5 <sfan5@live.de> | 2020-02-25 16:08:47 +0100 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2020-02-25 16:08:47 +0100 |
commit | e2fc93022b46b86070651c5730664baaa363da72 (patch) | |
tree | 15a93e831d7eea1a6de7cf40929cec9ca18a2cec /src | |
parent | 6be7150cd5c18869911bcba8e5833155521d2780 (diff) | |
download | minetest-e2fc93022b46b86070651c5730664baaa363da72.tar.gz minetest-e2fc93022b46b86070651c5730664baaa363da72.tar.bz2 minetest-e2fc93022b46b86070651c5730664baaa363da72.zip |
Fix potential problem with core.get_connected_players()
Diffstat (limited to 'src')
-rw-r--r-- | src/script/lua_api/l_env.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/script/lua_api/l_env.cpp b/src/script/lua_api/l_env.cpp index 7d5de896d..ac52941b3 100644 --- a/src/script/lua_api/l_env.cpp +++ b/src/script/lua_api/l_env.cpp @@ -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); |