diff options
author | Loic Blot <loic.blot@unix-experience.fr> | 2016-10-08 16:31:22 +0200 |
---|---|---|
committer | Ner'zhul <nerzhul@users.noreply.github.com> | 2016-10-08 22:27:44 +0200 |
commit | fd5a130b86c08f0b3190c3d81affd4869c139fb7 (patch) | |
tree | 8300ec1e77cfd8c38292f5b81e8e0fb82de0d53d /src/clientiface.cpp | |
parent | 067766eec213918b6cb5b2533d0c78eceb3949ec (diff) | |
download | minetest-fd5a130b86c08f0b3190c3d81affd4869c139fb7.tar.gz minetest-fd5a130b86c08f0b3190c3d81affd4869c139fb7.tar.bz2 minetest-fd5a130b86c08f0b3190c3d81affd4869c139fb7.zip |
More code cleanup (UNORDERED + RemotePlayer/LocalPlayer)
* ClientEnvironment now uses UNORDERED MAP for active objects
* Use RemotePlayer and LocalPlayer everywhere it's possible
* Minor code style fixes
* Drop Client::getBreath() unused function
Diffstat (limited to 'src/clientiface.cpp')
-rw-r--r-- | src/clientiface.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/clientiface.cpp b/src/clientiface.cpp index e7ad39579..e55c07cb6 100644 --- a/src/clientiface.cpp +++ b/src/clientiface.cpp @@ -77,9 +77,9 @@ void RemoteClient::GetNextBlocks ( if(m_nothing_to_send_pause_timer >= 0) return; - Player *player = env->getPlayer(peer_id); + RemotePlayer *player = env->getPlayer(peer_id); // This can happen sometimes; clients and players are not in perfect sync. - if(player == NULL) + if (player == NULL) return; // Won't send anything if already sending @@ -645,8 +645,7 @@ void ClientInterface::step(float dtime) void ClientInterface::UpdatePlayerList() { - if (m_env != NULL) - { + if (m_env != NULL) { std::vector<u16> clients = getClientIDs(); m_clients_names.clear(); @@ -654,10 +653,8 @@ void ClientInterface::UpdatePlayerList() if(!clients.empty()) infostream<<"Players:"<<std::endl; - for(std::vector<u16>::iterator - i = clients.begin(); - i != clients.end(); ++i) { - Player *player = m_env->getPlayer(*i); + for (std::vector<u16>::iterator i = clients.begin(); i != clients.end(); ++i) { + RemotePlayer *player = m_env->getPlayer(*i); if (player == NULL) continue; |