aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCraig Robbins <kde.psych@gmail.com>2015-03-17 17:39:59 +1000
committerCraig Robbins <kde.psych@gmail.com>2015-03-17 17:39:59 +1000
commitdbe5a446c3de175a30f1e7070c8623e975a6e48f (patch)
treef1c1652b6d9256601dfafb91de9b93eb3af1837e /src
parentc552d293fa340a1484d0b918b3341d7d141e7931 (diff)
downloadminetest-dbe5a446c3de175a30f1e7070c8623e975a6e48f.tar.gz
minetest-dbe5a446c3de175a30f1e7070c8623e975a6e48f.tar.bz2
minetest-dbe5a446c3de175a30f1e7070c8623e975a6e48f.zip
Minor bug fix (lag between damage flash and hearts updating)
Diffstat (limited to 'src')
-rw-r--r--src/environment.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/environment.cpp b/src/environment.cpp
index f83414a6a..9fbc8c519 100644
--- a/src/environment.cpp
+++ b/src/environment.cpp
@@ -2562,11 +2562,13 @@ void ClientEnvironment::damageLocalPlayer(u8 damage, bool handle_hp)
{
LocalPlayer *lplayer = getLocalPlayer();
assert(lplayer);
-
- if (handle_hp && lplayer->hp > damage)
- lplayer->hp -= damage;
- else
- lplayer->hp = 0;
+
+ if (handle_hp) {
+ if (lplayer->hp > damage)
+ lplayer->hp -= damage;
+ else
+ lplayer->hp = 0;
+ }
ClientEnvEvent event;
event.type = CEE_PLAYER_DAMAGE;