From bd9877563a07293336583f8cca9c468c66cc2262 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Wed, 19 Oct 2022 11:34:44 -0300 Subject: [PATCH] Species name read from form instead of dex number --- src/pokedex.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/pokedex.c b/src/pokedex.c index a7dd362ce8..7289c847f1 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -2454,7 +2454,7 @@ static void CreateMonListEntry(u8 position, u16 b, u16 ignored) { CreateMonDexNum(entryNum, 0x12, i * 2, ignored); CreateCaughtBall(sPokedexView->pokedexList[entryNum].owned, 0x11, i * 2, ignored); - CreateMonName(sPokedexView->pokedexList[entryNum].dexNum, 0x16, i * 2); + CreateMonName(sPokedexView->pokedexList[entryNum].seenSpecies, 0x16, i * 2); } else { @@ -2479,7 +2479,7 @@ static void CreateMonListEntry(u8 position, u16 b, u16 ignored) { CreateMonDexNum(entryNum, 18, sPokedexView->listVOffset * 2, ignored); CreateCaughtBall(sPokedexView->pokedexList[entryNum].owned, 0x11, sPokedexView->listVOffset * 2, ignored); - CreateMonName(sPokedexView->pokedexList[entryNum].dexNum, 0x16, sPokedexView->listVOffset * 2); + CreateMonName(sPokedexView->pokedexList[entryNum].seenSpecies, 0x16, sPokedexView->listVOffset * 2); } else { @@ -2503,7 +2503,7 @@ static void CreateMonListEntry(u8 position, u16 b, u16 ignored) { CreateMonDexNum(entryNum, 18, vOffset * 2, ignored); CreateCaughtBall(sPokedexView->pokedexList[entryNum].owned, 0x11, vOffset * 2, ignored); - CreateMonName(sPokedexView->pokedexList[entryNum].dexNum, 0x16, vOffset * 2); + CreateMonName(sPokedexView->pokedexList[entryNum].seenSpecies, 0x16, vOffset * 2); } else { @@ -2540,13 +2540,12 @@ static void CreateCaughtBall(bool16 owned, u8 x, u8 y, u16 unused) FillWindowPixelRect(0, PIXEL_FILL(0), x * 8, y * 8, 8, 16); } -static u8 CreateMonName(u16 num, u8 left, u8 top) +static u8 CreateMonName(u16 species, u8 left, u8 top) { const u8 *str; - num = NationalPokedexNumToSpecies(num); - if (num) - str = gSpeciesNames[num]; + if (species >= NUM_SPECIES) + str = gSpeciesNames[species]; else str = sText_TenDashes; PrintMonDexNumAndName(0, FONT_NARROW, str, left, top); @@ -3662,7 +3661,7 @@ static void Task_LoadCryScreen(u8 taskId) break; case 4: PrintInfoScreenText(gText_CryOf, 82, 33); - PrintCryScreenSpeciesName(0, sPokedexListItem->dexNum, 82, 49); + PrintCryScreenSpeciesName(0, sPokedexListItem->seenSpecies, 82, 49); gMain.state++; break; case 5: