diff options
author | Loïc Blot <nerzhul@users.noreply.github.com> | 2017-09-30 12:00:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-30 12:00:05 +0200 |
commit | be10c0893e2e6d1852a027abccc4cd3cdc85a140 (patch) | |
tree | eabfe8164007c420326f52bfc7e13e9be0f6bfb6 /src/script/lua_api/l_object.cpp | |
parent | f729b5d2bdc65ce3c51f1004c58cb93a37504b49 (diff) | |
download | minetest-be10c0893e2e6d1852a027abccc4cd3cdc85a140.tar.gz minetest-be10c0893e2e6d1852a027abccc4cd3cdc85a140.tar.bz2 minetest-be10c0893e2e6d1852a027abccc4cd3cdc85a140.zip |
Make Player::peer_id server-side only and add getters and setters (#6478)
* Make Player::peer_id server-side only and add getters and setters
Player::peer_id has no sense client side, move it to server, make it private and add setter and getter
Also add some PEER_ID_INEXISTENT instead of harcoded 0
Diffstat (limited to 'src/script/lua_api/l_object.cpp')
-rw-r--r-- | src/script/lua_api/l_object.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/script/lua_api/l_object.cpp b/src/script/lua_api/l_object.cpp index 4e4901db5..bc150d70f 100644 --- a/src/script/lua_api/l_object.cpp +++ b/src/script/lua_api/l_object.cpp @@ -1023,7 +1023,7 @@ int ObjectRef::l_is_player_connected(lua_State *L) NO_MAP_LOCK_REQUIRED; ObjectRef *ref = checkobject(L, 1); RemotePlayer *player = getplayer(ref); - lua_pushboolean(L, (player != NULL && player->peer_id != 0)); + lua_pushboolean(L, (player != NULL && player->getPeerId() != PEER_ID_INEXISTENT)); return 1; } |