Merge pull request #1296 from GriffinRichards/bugfix-typo

Add missing braces to bugfix in CalculateMonStats
This commit is contained in:
GriffinR 2021-01-10 12:34:39 -05:00 committed by GitHub
commit e6aebc16da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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;
}