mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Use the new Player::isDead function when it's the case
This commit is contained in:
parent
7c19933a8c
commit
4e63c977c7
3 changed files with 13 additions and 7 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue