Add fix to disallow negative current HP values
This commit is contained in:
+7
-1
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user