Skip to content
Snippets Groups Projects
Commit afb19f3a authored by Loïc Blot's avatar Loïc Blot
Browse files

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
parent 3067d782
No related branches found
No related tags found
No related merge requests found
......@@ -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: "
......
......@@ -238,6 +238,9 @@ class Player
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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment