BlockMen / hunger

Hunger mechanics for Minetest; needs Better HUD (https://github.com/BlockMen/hud)
GNU Lesser General Public License v2.1
8 stars 3 forks source link

Check if player is alive before dealing starve damage #10

Open volkj opened 8 years ago

volkj commented 8 years ago

When a player dies of starvation it happens that chat message "You died" appears again and again if the player doesn't press Respawn button.

With this edit the damage dealing function checks if the player has life available ( hp > 0) before dealing damage, leading to not execute the function again and again after the player is dead.

It should solve problems with mods that prints death messages and drops inventory.

MoNTE48 commented 8 years ago

https://github.com/tenplus1/hud_hunger

groenkek commented 6 years ago

Instead of stopping damage after the hp drops below zero, how about using something like max(hp-damage, 0)