Merge pull request #465 from SatoMew/master
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)
|
if (currentHP == 0 && oldMaxHP == 0)
|
||||||
currentHP = newMaxHP;
|
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;
|
currentHP += newMaxHP - oldMaxHP;
|
||||||
|
#ifdef BUGFIX
|
||||||
|
if (currentHP <= 0)
|
||||||
|
currentHP = 1;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
else
|
else
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user