fix: poison setting life to 1hp

This commit is contained in:
Lord_Cambion 2026-04-08 17:28:13 +02:00
parent 5f71ac96ff
commit a204ec52f4

View file

@ -137,12 +137,9 @@ void MobEffect::applyEffectTick(shared_ptr<LivingEntity> mob, int amplification)
}
else if (id == poison->id)
{
float health = mob->getHealth();
if (health > 1.0f)
if (mob->getHealth() > 1.0f)
{
float safeDmg = health - 1.0f;
if (safeDmg > 0.0f)
mob->hurt(DamageSource::magic, safeDmg);
mob->hurt(DamageSource::magic, 1.0f);
}
}
else if (id == wither->id)