aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/script/lua_api/l_env.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/script/lua_api/l_env.cpp b/src/script/lua_api/l_env.cpp
index ac52941b3..6e67e547b 100644
--- a/src/script/lua_api/l_env.cpp
+++ b/src/script/lua_api/l_env.cpp
@@ -651,7 +651,7 @@ int ModApiEnvMod::l_get_connected_players(lua_State *L)
if (player->getPeerId() == PEER_ID_INEXISTENT)
continue;
PlayerSAO *sao = player->getPlayerSAO();
- if (sao) {
+ if (sao && !sao->isGone()) {
getScriptApiBase(L)->objectrefGetOrCreate(L, sao);
lua_rawseti(L, -2, ++i);
}