1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-14 00:55:20 +02:00

Use the new Player::isDead function when it's the case

This commit is contained in:
Loic Blot
2015-03-13 08:57:19 +01:00
parent 7c19933a8c
commit 4e63c977c7
3 changed files with 13 additions and 7 deletions

View File

@@ -2563,9 +2563,11 @@ void ClientEnvironment::damageLocalPlayer(u8 damage, bool handle_hp)
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