summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/pokemon.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/pokemon.c b/src/pokemon.c
index 39cc2f636..6e43aff85 100644
--- a/src/pokemon.c
+++ b/src/pokemon.c
@@ -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;
}