Fixed non-HGSS dex showing 4 digits in list when National Dex is disabled (#3655)

This commit is contained in:
Eduardo Quezada D'Ottone 2023-12-08 12:18:00 -03:00 committed by GitHub
parent bb457b87de
commit 2a329cacf7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 11 deletions

View file

@ -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);

View file

@ -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);
}

View file

@ -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);
}