aboutsummaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorLoic Blot <loic.blot@unix-experience.fr>2015-03-13 08:57:19 +0100
committerLoic Blot <loic.blot@unix-experience.fr>2015-03-13 08:57:58 +0100
commit4e63c977c782e81e828445d20c836d84e3ba1766 (patch)
tree80467660176c9ddfab9880e2204687de3d01dbb3 /src/network
parent7c19933a8cca173157e0c21923cafe56b2334708 (diff)
downloadminetest-4e63c977c782e81e828445d20c836d84e3ba1766.tar.gz
minetest-4e63c977c782e81e828445d20c836d84e3ba1766.tar.bz2
minetest-4e63c977c782e81e828445d20c836d84e3ba1766.zip
Use the new Player::isDead function when it's the case
Diffstat (limited to 'src/network')
-rw-r--r--src/network/packethandlers/server.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/network/packethandlers/server.cpp b/src/network/packethandlers/server.cpp
index b188bb931..537858e52 100644
--- a/src/network/packethandlers/server.cpp
+++ b/src/network/packethandlers/server.cpp
@@ -556,7 +556,9 @@ void Server::handleCommand_PlayerPos(NetworkPacket* pkt)
}
// If player is dead we don't care of this packet
- if (player->hp == 0) {
+ if (player->isDead()) {
+ verbosestream << "TOSERVER_PLAYERPOS: " << player->getName()
+ << " is dead. Ignoring packet";
return;
}
@@ -921,6 +923,8 @@ void Server::handleCommand_Breath(NetworkPacket* pkt)
* He is dead !
*/
if (player->isDead()) {
+ verbosestream << "TOSERVER_BREATH: " << player->getName()
+ << " is dead. Ignoring packet";
return;
}
@@ -1051,7 +1055,7 @@ void Server::handleCommand_Respawn(NetworkPacket* pkt)
return;
}
- if (player->hp != 0 || !g_settings->getBool("enable_damage"))
+ if (!player->isDead() || !g_settings->getBool("enable_damage"))
return;
RespawnPlayer(pkt->getPeerId());
@@ -1108,9 +1112,9 @@ void Server::handleCommand_Interact(NetworkPacket* pkt)
return;
}
- if (player->hp == 0) {
+ if (player->isDead()) {
verbosestream << "TOSERVER_INTERACT: " << player->getName()
- << " tried to interact, but is dead!" << std::endl;
+ << " is dead. Ignoring packet";
return;
}