diff options
Diffstat (limited to 'src/server.cpp')
-rw-r--r-- | src/server.cpp | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/src/server.cpp b/src/server.cpp index 6a1e8085b..3536471bf 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -605,17 +605,6 @@ void Server::AsyncRunStep(bool initial_step) continue; /* - Handle player HPs (die if hp=0) - */ - if(playersao->m_hp_not_sent && g_settings->getBool("enable_damage")) - { - if(playersao->getHP() == 0) - DiePlayer(*i); - else - SendPlayerHP(*i); - } - - /* Send player breath if changed */ if(playersao->m_breath_not_sent) { @@ -1889,7 +1878,6 @@ void Server::SendPlayerHP(u16 peer_id) DSTACK(__FUNCTION_NAME); PlayerSAO *playersao = getPlayerSAO(peer_id); assert(playersao); - playersao->m_hp_not_sent = false; SendHP(peer_id, playersao->getHP()); m_script->player_event(playersao,"health_changed"); @@ -2588,9 +2576,9 @@ void Server::DiePlayer(u16 peer_id) PlayerSAO *playersao = getPlayerSAO(peer_id); assert(playersao); - infostream<<"Server::DiePlayer(): Player " - <<playersao->getPlayer()->getName() - <<" dies"<<std::endl; + infostream << "Server::DiePlayer(): Player " + << playersao->getPlayer()->getName() + << " dies" << std::endl; playersao->setHP(0); @@ -2608,13 +2596,15 @@ void Server::RespawnPlayer(u16 peer_id) PlayerSAO *playersao = getPlayerSAO(peer_id); assert(playersao); - infostream<<"Server::RespawnPlayer(): Player " - <<playersao->getPlayer()->getName() - <<" respawns"<<std::endl; + infostream << "Server::RespawnPlayer(): Player " + << playersao->getPlayer()->getName() + << " respawns" << std::endl; playersao->setHP(PLAYER_MAX_HP); playersao->setBreath(PLAYER_MAX_BREATH); + SendPlayerHP(peer_id); + bool repositioned = m_script->on_respawnplayer(playersao); if(!repositioned){ v3f pos = findSpawnPos(m_env->getServerMap()); |