mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-15 01:25:20 +02:00
Move core.get_connected_players() implementation to C++
Keeping the ObjectRefs around in a table isn't ideal and this allows
removing the somewhat nonsensical is_player_connected() added in 86ef7147
.
This commit is contained in:
@@ -1063,6 +1063,9 @@ int ObjectRef::l_get_luaentity(lua_State *L)
|
||||
int ObjectRef::l_is_player_connected(lua_State *L)
|
||||
{
|
||||
NO_MAP_LOCK_REQUIRED;
|
||||
// This method was once added for a bugfix, but never documented
|
||||
log_deprecated(L, "is_player_connected is undocumented and "
|
||||
"will be removed in a future release");
|
||||
ObjectRef *ref = checkobject(L, 1);
|
||||
RemotePlayer *player = getplayer(ref);
|
||||
lua_pushboolean(L, (player != NULL && player->getPeerId() != PEER_ID_INEXISTENT));
|
||||
|
Reference in New Issue
Block a user