aboutsummaryrefslogtreecommitdiff
path: root/src/server.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server.cpp')
-rw-r--r--src/server.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/server.cpp b/src/server.cpp
index fa7a838d4..60dbef0d2 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -1076,8 +1076,7 @@ PlayerSAO* Server::StageTwoClientInit(u16 peer_id)
}
m_clients.unlock();
- RemotePlayer *player =
- static_cast<RemotePlayer*>(m_env->getPlayer(playername.c_str()));
+ RemotePlayer *player = m_env->getPlayer(playername.c_str());
// If failed, cancel
if ((playersao == NULL) || (player == NULL)) {
@@ -1113,7 +1112,7 @@ PlayerSAO* Server::StageTwoClientInit(u16 peer_id)
SendPlayerHPOrDie(playersao);
// Send Breath
- SendPlayerBreath(peer_id);
+ SendPlayerBreath(playersao);
// Show death screen if necessary
if (playersao->isDead())
@@ -1857,14 +1856,13 @@ void Server::SendPlayerHP(u16 peer_id)
playersao->m_messages_out.push(aom);
}
-void Server::SendPlayerBreath(u16 peer_id)
+void Server::SendPlayerBreath(PlayerSAO *sao)
{
DSTACK(FUNCTION_NAME);
- PlayerSAO *playersao = getPlayerSAO(peer_id);
- assert(playersao);
+ assert(sao);
- m_script->player_event(playersao, "breath_changed");
- SendBreath(peer_id, playersao->getBreath());
+ m_script->player_event(sao, "breath_changed");
+ SendBreath(sao->getPeerID(), sao->getBreath());
}
void Server::SendMovePlayer(u16 peer_id)
@@ -2565,7 +2563,6 @@ void Server::RespawnPlayer(u16 peer_id)
}
SendPlayerHP(peer_id);
- SendPlayerBreath(peer_id);
}