Fix for issue where player is able to stay alive with zero hearts in their healthbar.

This commit is contained in:
la 2026-03-10 12:58:18 +10:00
parent 58c236ead5
commit 5e273fe45b

View file

@ -195,8 +195,8 @@ void IUIScene_HUD::renderPlayerHealth()
// Update health
bool blink = pMinecraft->localplayers[iPad]->invulnerableTime / 3 % 2 == 1;
if (pMinecraft->localplayers[iPad]->invulnerableTime < 10) blink = false;
int currentHealth = pMinecraft->localplayers[iPad]->getHealth();
int oldHealth = pMinecraft->localplayers[iPad]->lastHealth;
int currentHealth = (int)ceil(pMinecraft->localplayers[iPad]->getHealth());
int oldHealth = (int)ceil(pMinecraft->localplayers[iPad]->lastHealth);
bool bHasPoison = pMinecraft->localplayers[iPad]->hasEffect(MobEffect::poison);
bool bHasWither = pMinecraft->localplayers[iPad]->hasEffect(MobEffect::wither);
AttributeInstance *maxHealthAttribute = pMinecraft->localplayers[iPad]->getAttribute(SharedMonsterAttributes::MAX_HEALTH);