From 8afc28c98ffe55e9abf747ec274eaaa826c177a8 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sun, 10 Jan 2021 12:24:59 -0500 Subject: [PATCH] Add missing braces to bugfix in CalculateMonStats --- src/pokemon.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pokemon.c b/src/pokemon.c index b5eee16b2..e8c6a6f49 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -2859,13 +2859,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. This causes the pomeg berry glitch. currentHP += newMaxHP - oldMaxHP; #ifdef BUGFIX if (currentHP <= 0) currentHP = 1; #endif + } else return; }