From: Craig Robbins Date: Tue, 17 Mar 2015 07:39:59 +0000 (+1000) Subject: Minor bug fix (lag between damage flash and hearts updating) X-Git-Tag: 0.4.13~472 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=dbe5a446c3de175a30f1e7070c8623e975a6e48f;p=oweals%2Fminetest.git Minor bug fix (lag between damage flash and hearts updating) --- 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;