diff options
author | drifloony <drifloony@users.noreply.github.com> | 2017-07-16 02:50:55 -0700 |
---|---|---|
committer | drifloony <drifloony@users.noreply.github.com> | 2017-07-16 02:59:58 -0700 |
commit | c46baaf6732d68f5908a1f3c826e9aa2f88c3ff3 (patch) | |
tree | 79276ef97b93745b2b6a047e40e777281cea3b5e /src | |
parent | 198b4724d78ad2d40dedd67a5a79cba97cdc3c33 (diff) |
remove goto in CalculateMonStats
Diffstat (limited to 'src')
-rw-r--r-- | src/pokemon_1.c | 22 |
1 files changed, 10 insertions, 12 deletions
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) |