aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2020-02-25 16:08:47 +0100
committersfan5 <sfan5@live.de>2020-02-25 16:08:47 +0100
commite2fc93022b46b86070651c5730664baaa363da72 (patch)
tree15a93e831d7eea1a6de7cf40929cec9ca18a2cec /src
parent6be7150cd5c18869911bcba8e5833155521d2780 (diff)
downloadminetest-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.cpp2
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);