Add missing braces to bugfix in CalculateMonStats

This commit is contained in:
GriffinR 2021-01-10 12:24:59 -05:00
parent c506cf747f
commit 8afc28c98f

View File

@ -2859,13 +2859,14 @@ void CalculateMonStats(struct Pokemon *mon)
{
if (currentHP == 0 && oldMaxHP == 0)
currentHP = newMaxHP;
else if (currentHP != 0)
else if (currentHP != 0) {
// BUG: currentHP is unintentionally able to become <= 0 after the instruction below. This causes the pomeg berry glitch.
currentHP += newMaxHP - oldMaxHP;
#ifdef BUGFIX
if (currentHP <= 0)
currentHP = 1;
#endif
}
else
return;
}