diff options
-rw-r--r-- | src/network/packethandlers/server.cpp | 9 | ||||
-rw-r--r-- | src/player.h | 3 |
2 files changed, 12 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: " diff --git a/src/player.h b/src/player.h index 4459b421a..def428847 100644 --- a/src/player.h +++ b/src/player.h @@ -238,6 +238,9 @@ public: inventory.setModified(x); } + // Use a function, if isDead can be defined by other conditions + bool isDead() { return hp == 0; } + bool touching_ground; // This oscillates so that the player jumps a bit above the surface bool in_liquid; |