From: sfan5 Date: Tue, 25 Feb 2020 15:08:47 +0000 (+0100) Subject: Fix potential problem with core.get_connected_players() X-Git-Tag: 5.2.0~100 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e2fc93022b46b86070651c5730664baaa363da72;p=oweals%2Fminetest.git Fix potential problem with core.get_connected_players() --- 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);