aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/environment.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/environment.cpp b/src/environment.cpp
index 953fa2860..f83414a6a 100644
--- a/src/environment.cpp
+++ b/src/environment.cpp
@@ -2563,16 +2563,10 @@ void ClientEnvironment::damageLocalPlayer(u8 damage, bool handle_hp)
LocalPlayer *lplayer = getLocalPlayer();
assert(lplayer);
- if(handle_hp) {
- // Don't damage a dead player
- if (lplayer->isDead())
- return;
-
- if(lplayer->hp > damage)
- lplayer->hp -= damage;
- else
- lplayer->hp = 0;
- }
+ if (handle_hp && lplayer->hp > damage)
+ lplayer->hp -= damage;
+ else
+ lplayer->hp = 0;
ClientEnvEvent event;
event.type = CEE_PLAYER_DAMAGE;