LocalPlayer *lplayer = getLocalPlayer();
assert(lplayer);
- if(handle_hp){
- if (lplayer->hp == 0) // Don't damage a dead player
+ if(handle_hp) {
+ // Don't damage a dead player
+ if (lplayer->isDead())
return;
+
if(lplayer->hp > damage)
lplayer->hp -= damage;
else
}
// 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;
}
* He is dead !
*/
if (player->isDead()) {
+ verbosestream << "TOSERVER_BREATH: " << player->getName()
+ << " is dead. Ignoring packet";
return;
}
return;
}
- if (player->hp != 0 || !g_settings->getBool("enable_damage"))
+ if (!player->isDead() || !g_settings->getBool("enable_damage"))
return;
RespawnPlayer(pkt->getPeerId());
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;
}
SendPlayerBreath(peer_id);
// Show death screen if necessary
- if(player->hp == 0)
+ if(player->isDead())
SendDeathscreen(peer_id, false, v3f(0,0,0));
// Note things in chat if not in simple singleplayer mode