From: Craig Robbins Date: Tue, 17 Mar 2015 06:21:48 +0000 (+1000) Subject: Fix various damage related bugs (client-side) X-Git-Tag: 0.4.13~473 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=c552d293fa340a1484d0b918b3341d7d141e7931;p=oweals%2Fminetest.git Fix various damage related bugs (client-side) E.g. spawning or teleporting into lava to become invinsible --- diff --git a/src/environment.cpp b/src/environment.cpp index 953fa2860..f83414a6a 100644 --- a/src/environment.cpp +++ b/src/environment.cpp @@ -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;