From c46baaf6732d68f5908a1f3c826e9aa2f88c3ff3 Mon Sep 17 00:00:00 2001 From: drifloony Date: Sun, 16 Jul 2017 02:50:55 -0700 Subject: remove goto in CalculateMonStats --- src/pokemon_1.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/pokemon_1.c b/src/pokemon_1.c index 185caaed2..231fc33ed 100644 --- a/src/pokemon_1.c +++ b/src/pokemon_1.c @@ -444,23 +444,21 @@ void CalculateMonStats(struct Pokemon *mon) if (species == SPECIES_SHEDINJA) { if (currentHP != 0 || oldMaxHP == 0) - { currentHP = 1; - goto set_hp; - } + else + return; } else { - if (currentHP != 0 || oldMaxHP == 0) - { - if (currentHP != 0) - currentHP += newMaxHP - oldMaxHP; - else if (oldMaxHP == 0) - currentHP = newMaxHP; - set_hp: - SetMonData(mon, MON_DATA_HP, (u8 *)¤tHP); - } + if (currentHP == 0 && oldMaxHP == 0) + currentHP = newMaxHP; + else if (currentHP != 0) + currentHP += newMaxHP - oldMaxHP; + else + return; } + + SetMonData(mon, MON_DATA_HP, (u8 *)¤tHP); } void sub_803B4B4(struct Pokemon *src, struct Pokemon *dest) -- cgit v1.2.3