diff options
author | Loic Blot <loic.blot@unix-experience.fr> | 2015-03-12 11:27:28 +0100 |
---|---|---|
committer | Loic Blot <loic.blot@unix-experience.fr> | 2015-03-12 11:27:28 +0100 |
commit | afb19f3a1f73d36207b8b64e4eed5846e78f5a32 (patch) | |
tree | 2088237d52a9d21d091f0e7a11c3ca4cf9528df4 /src/network | |
parent | 3067d782169a79ab3b13e8ba3d445b60d0d477c5 (diff) | |
download | minetest-afb19f3a1f73d36207b8b64e4eed5846e78f5a32.tar.gz minetest-afb19f3a1f73d36207b8b64e4eed5846e78f5a32.tar.bz2 minetest-afb19f3a1f73d36207b8b64e4eed5846e78f5a32.zip |
handleCommand_Breath mustn't update breath is player is dead. A dead player doesn't breath.
Add Player::isDead function to check player is dead
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/packethandlers/server.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/network/packethandlers/server.cpp b/src/network/packethandlers/server.cpp index d24e8df5b..b188bb931 100644 --- a/src/network/packethandlers/server.cpp +++ b/src/network/packethandlers/server.cpp @@ -916,6 +916,15 @@ void Server::handleCommand_Breath(NetworkPacket* pkt) return; } + /* + * If player is dead, we don't need to update the breath + * He is dead ! + */ + if (player->isDead()) { + return; + } + + PlayerSAO *playersao = player->getPlayerSAO(); if (playersao == NULL) { errorstream << "Server::ProcessData(): Cancelling: " |