1
0
mirror of https://github.com/moparisthebest/minetest synced 2024-12-22 15:48:48 -05:00

Fix various damage related bugs (client-side)

E.g. spawning or teleporting into lava to become invinsible
This commit is contained in:
Craig Robbins 2015-03-17 16:21:48 +10:00
parent 34c5a5b377
commit c552d293fa

View File

@ -2563,16 +2563,10 @@ void ClientEnvironment::damageLocalPlayer(u8 damage, bool handle_hp)
LocalPlayer *lplayer = getLocalPlayer();
assert(lplayer);
if(handle_hp) {
// Don't damage a dead player
if (lplayer->isDead())
return;
if(lplayer->hp > damage)
lplayer->hp -= damage;
else
lplayer->hp = 0;
}
if (handle_hp && lplayer->hp > damage)
lplayer->hp -= damage;
else
lplayer->hp = 0;
ClientEnvEvent event;
event.type = CEE_PLAYER_DAMAGE;