Merge pull request #465 from SatoMew/master

Add fix to disallow negative current HP values
This commit is contained in:
GriffinR
2021-09-14 13:27:28 -04:00
committed by GitHub
+7 -1
View File
@@ -2112,8 +2112,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.
currentHP += newMaxHP - oldMaxHP;
#ifdef BUGFIX
if (currentHP <= 0)
currentHP = 1;
#endif
}
else
return;
}