diff options
author | Loic Blot <loic.blot@unix-experience.fr> | 2015-01-26 12:21:18 +0100 |
---|---|---|
committer | Loic Blot <loic.blot@unix-experience.fr> | 2015-02-10 16:03:16 +0100 |
commit | bb59a8543d44b566d8b39fd4727d552a8d4f3e90 (patch) | |
tree | 18dfc78b19412e08610c9b898084276cfba14db0 | |
parent | da8199799db9981e6e34f34efa0abb9db16e5f0a (diff) | |
download | minetest-bb59a8543d44b566d8b39fd4727d552a8d4f3e90.tar.gz minetest-bb59a8543d44b566d8b39fd4727d552a8d4f3e90.tar.bz2 minetest-bb59a8543d44b566d8b39fd4727d552a8d4f3e90.zip |
Replace getPlayer(playername) by getPlayer(peer_id) in some possible cases. ok @Zeno-
-rw-r--r-- | src/server.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/server.cpp b/src/server.cpp index 826350505..5062c425e 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -1192,7 +1192,7 @@ PlayerSAO* Server::StageTwoClientInit(u16 peer_id) m_clients.Unlock(); RemotePlayer *player = - static_cast<RemotePlayer*>(m_env->getPlayer(playername.c_str())); + static_cast<RemotePlayer*>(m_env->getPlayer(peer_id)); // If failed, cancel if((playersao == NULL) || (player == NULL)) { @@ -1602,7 +1602,6 @@ void Server::handleCommand_Init2(ToServerPacket* pkt) m_clients.event(pkt->getPeerId(), CSE_GotInit2); u16 protocol_version = m_clients.getProtocolVersion(pkt->getPeerId()); - ///// begin compatibility code PlayerSAO* playersao = NULL; if (protocol_version <= 22) { @@ -5138,13 +5137,12 @@ v3f findSpawnPos(ServerMap &map) PlayerSAO* Server::emergePlayer(const char *name, u16 peer_id) { - RemotePlayer *player = NULL; bool newplayer = false; /* Try to get an existing player */ - player = static_cast<RemotePlayer*>(m_env->getPlayer(name)); + RemotePlayer *player = static_cast<RemotePlayer*>(m_env->getPlayer(name)); // If player is already connected, cancel if(player != NULL && player->peer_id != 0) |