mirror of
https://github.com/minetest/minetest.git
synced 2024-11-30 11:33:44 +01:00
Minor bug fix (lag between damage flash and hearts updating)
This commit is contained in:
parent
c552d293fa
commit
dbe5a446c3
@ -2563,10 +2563,12 @@ 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;
|
||||||
|
Loading…
Reference in New Issue
Block a user