diff --git a/include/pokemon.h b/include/pokemon.h index fc9772cc30..924120941a 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -632,7 +632,6 @@ u8 GetNature(struct Pokemon *mon); u8 GetNatureFromPersonality(u32 personality); u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 type, u16 evolutionItem, struct Pokemon *tradePartner); bool8 IsMonPastEvolutionLevel(struct Pokemon *mon); -u16 HoennPokedexNumToSpecies(u16 hoennNum); u16 NationalPokedexNumToSpecies(u16 nationalNum); u16 NationalToHoennOrder(u16 nationalNum); u16 SpeciesToNationalPokedexNum(u16 species); diff --git a/src/pokedex.c b/src/pokedex.c index 377105610f..33b7dd02dd 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -2434,15 +2434,15 @@ static void CreateMonDexNum(u16 entryNum, u8 left, u8 top, u16 unused) if (sPokedexView->dexMode == DEX_MODE_HOENN) dexNum = NationalToHoennOrder(dexNum); memcpy(text, sText_No0000, ARRAY_COUNT(sText_No0000)); - if (NATIONAL_DEX_COUNT > 999) + if (NATIONAL_DEX_COUNT > 999 && sPokedexView->dexMode != DEX_MODE_HOENN) { text[2] = CHAR_0 + dexNum / 1000; offset++; } - text[offset] = CHAR_0 + (dexNum % 1000) / 100; - text[offset + 1] = CHAR_0 + ((dexNum % 1000) % 100) / 10; - text[offset + 2] = CHAR_0 + ((dexNum % 1000) % 100) % 10; - text[offset + 3] = EOS; + text[offset++] = CHAR_0 + (dexNum % 1000) / 100; + text[offset++] = CHAR_0 + ((dexNum % 1000) % 100) / 10; + text[offset++] = CHAR_0 + ((dexNum % 1000) % 100) % 10; + text[offset++] = EOS; PrintMonDexNumAndName(0, FONT_NARROW, text, left, top); } diff --git a/src/pokedex_plus_hgss.c b/src/pokedex_plus_hgss.c index 2553c856ba..2907fda7b1 100644 --- a/src/pokedex_plus_hgss.c +++ b/src/pokedex_plus_hgss.c @@ -2802,12 +2802,12 @@ static void CreateMonDexNum(u16 entryNum, u8 left, u8 top, u16 unused) if (NATIONAL_DEX_COUNT > 999 && sPokedexView->dexMode != DEX_MODE_HOENN) { text[0] = CHAR_0 + dexNum / 1000; - offset = 1; + offset++; } - text[offset] = CHAR_0 + (dexNum % 1000) / 100; - text[offset + 1] = CHAR_0 + ((dexNum % 1000) % 100) / 10; - text[offset + 2] = CHAR_0 + ((dexNum % 1000) % 100) % 10; - text[offset + 3] = EOS; + text[offset++] = CHAR_0 + (dexNum % 1000) / 100; + text[offset++] = CHAR_0 + ((dexNum % 1000) % 100) / 10; + text[offset++] = CHAR_0 + ((dexNum % 1000) % 100) % 10; + text[offset++] = EOS; PrintMonDexNumAndName(0, FONT_NARROW, text, left, top); }