Minor bug fix (lag between damage flash and hearts updating)

master
Craig Robbins 2015-03-17 17:39:59 +10:00
parent c552d293fa
commit dbe5a446c3
1 changed files with 7 additions and 5 deletions

View File

@ -2562,11 +2562,13 @@ void ClientEnvironment::damageLocalPlayer(u8 damage, bool handle_hp)
{ {
LocalPlayer *lplayer = getLocalPlayer(); LocalPlayer *lplayer = getLocalPlayer();
assert(lplayer); assert(lplayer);
if (handle_hp && lplayer->hp > damage) if (handle_hp) {
lplayer->hp -= damage; if (lplayer->hp > damage)
else lplayer->hp -= damage;
lplayer->hp = 0; else
lplayer->hp = 0;
}
ClientEnvEvent event; ClientEnvEvent event;
event.type = CEE_PLAYER_DAMAGE; event.type = CEE_PLAYER_DAMAGE;