projects
/
oweals
/
minetest.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6be7150
)
Fix potential problem with core.get_connected_players()
author
sfan5
<sfan5@live.de>
Tue, 25 Feb 2020 15:08:47 +0000
(16:08 +0100)
committer
sfan5
<sfan5@live.de>
Tue, 25 Feb 2020 15:08:47 +0000
(16:08 +0100)
src/script/lua_api/l_env.cpp
patch
|
blob
|
history
diff --git
a/src/script/lua_api/l_env.cpp
b/src/script/lua_api/l_env.cpp
index 7d5de896d750250561a4b80c5829bb77bb85bf9e..ac52941b3553df61ff7df392861573bb411ebf96 100644
(file)
--- 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);