summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/pokemon_1.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/pokemon_1.c b/src/pokemon_1.c
index 4670f188f..76f5f3dfe 100644
--- a/src/pokemon_1.c
+++ b/src/pokemon_1.c
@@ -1754,8 +1754,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;
}