Skip to content

Commit

Permalink
Minor bug fix (lag between damage flash and hearts updating)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeno- committed Mar 17, 2015
1 parent c552d29 commit dbe5a44
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/environment.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit dbe5a44

Please sign in to comment.