diff options
Diffstat (limited to 'src/server.cpp')
-rw-r--r-- | src/server.cpp | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/src/server.cpp b/src/server.cpp index edd97e225..71e71f43e 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -1108,7 +1108,7 @@ PlayerSAO* Server::StageTwoClientInit(u16 peer_id) SendPlayerBreath(peer_id); // Show death screen if necessary - if(player->isDead()) + if (player->isDead()) SendDeathscreen(peer_id, false, v3f(0,0,0)); // Note things in chat if not in simple singleplayer mode @@ -3080,14 +3080,6 @@ void Server::hudSetHotbarSelectedImage(RemotePlayer *player, std::string name) SendHUDSetParam(player->peer_id, HUD_PARAM_HOTBAR_SELECTED_IMAGE, name); } -std::string Server::hudGetHotbarSelectedImage(RemotePlayer *player) -{ - if (!player) - return ""; - - return player->getHotbarSelectedImage(); -} - bool Server::setLocalPlayerAnimations(RemotePlayer *player, v2s32 animation_frames[4], f32 frame_speed) { @@ -3408,11 +3400,10 @@ PlayerSAO* Server::emergePlayer(const char *name, u16 peer_id, u16 proto_version /* Try to get an existing player */ - RemotePlayer *player = static_cast<RemotePlayer*>(m_env->getPlayer(name)); + RemotePlayer *player = m_env->getPlayer(name); // If player is already connected, cancel - if(player != NULL && player->peer_id != 0) - { + if (player != NULL && player->peer_id != 0) { infostream<<"emergePlayer(): Player already connected"<<std::endl; return NULL; } @@ -3420,8 +3411,7 @@ PlayerSAO* Server::emergePlayer(const char *name, u16 peer_id, u16 proto_version /* If player with the wanted peer_id already exists, cancel. */ - if(m_env->getPlayer(peer_id) != NULL) - { + if (m_env->getPlayer(peer_id) != NULL) { infostream<<"emergePlayer(): Player with wrong name but same" " peer_id already exists"<<std::endl; return NULL; @@ -3429,13 +3419,13 @@ PlayerSAO* Server::emergePlayer(const char *name, u16 peer_id, u16 proto_version // Load player if it isn't already loaded if (!player) { - player = static_cast<RemotePlayer*>(m_env->loadPlayer(name)); + player = m_env->loadPlayer(name); } // Create player if it doesn't exist if (!player) { newplayer = true; - player = new RemotePlayer(this, name); + player = new RemotePlayer(name, this->idef()); // Set player position infostream<<"Server: Finding spawn place for player \"" <<name<<"\""<<std::endl; |