summaryrefslogtreecommitdiff
path: root/src/evolution_scene.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/evolution_scene.c')
-rw-r--r--src/evolution_scene.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/evolution_scene.c b/src/evolution_scene.c
index cbd37be52..ec99fb030 100644
--- a/src/evolution_scene.c
+++ b/src/evolution_scene.c
@@ -113,7 +113,7 @@ static const u16 sUnknown_085B5884[] = INCBIN_U16("graphics/evolution_scene/tran
static const u8 Text_ShedinjaJapaneseName[] = _("ヌケニン");
-static const u8 sUnknown_085B58C9[][4] =
+static const u8 sUnknown_085B58C9[][4] =
{
{ 0x00, 0x0C, 0x01, 0x06 },
{ 0x0D, 0x24, 0x05, 0x02 },
@@ -575,16 +575,16 @@ static void CB2_TradeEvolutionSceneUpdate(void)
static void CreateShedinja(u16 preEvoSpecies, struct Pokemon* mon)
{
u32 data = 0;
- if (gEvolutionTable[preEvoSpecies].evolutions[0].method == EVO_LEVEL_NINJASK && gPlayerPartyCount < 6)
+ if (gEvolutionTable[preEvoSpecies][0].method == EVO_LEVEL_NINJASK && gPlayerPartyCount < 6)
{
s32 i;
- struct Pokemon* Shedinja = &gPlayerParty[gPlayerPartyCount];
- const struct EvolutionData* evoTable;
- const struct EvolutionData* evos;
+ struct Pokemon* shedinja = &gPlayerParty[gPlayerPartyCount];
+ const struct Evolution *evos;
+ const struct Evolution *evos2;
CopyMon(&gPlayerParty[gPlayerPartyCount], mon, sizeof(struct Pokemon));
- SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_SPECIES, (&gEvolutionTable[preEvoSpecies].evolutions[1].targetSpecies));
- SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_NICKNAME, (gSpeciesNames[gEvolutionTable[preEvoSpecies].evolutions[1].targetSpecies]));
+ SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_SPECIES, (&gEvolutionTable[preEvoSpecies][1].targetSpecies));
+ SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_NICKNAME, (gSpeciesNames[gEvolutionTable[preEvoSpecies][1].targetSpecies]));
SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_HELD_ITEM, (&data));
SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_MARKINGS, (&data));
SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_10, (&data));
@@ -602,15 +602,16 @@ static void CreateShedinja(u16 preEvoSpecies, struct Pokemon* mon)
CalculatePlayerPartyCount();
// can't match it otherwise, ehh
- evoTable = gEvolutionTable;
- evos = evoTable + preEvoSpecies;
- GetSetPokedexFlag(SpeciesToNationalPokedexNum(evos->evolutions[1].targetSpecies), FLAG_SET_SEEN);
- GetSetPokedexFlag(SpeciesToNationalPokedexNum(evos->evolutions[1].targetSpecies), FLAG_SET_CAUGHT);
+ evos2 = gEvolutionTable[0];
+ evos = evos2 + EVOS_PER_MON * preEvoSpecies;
- if (GetMonData(Shedinja, MON_DATA_SPECIES) == SPECIES_SHEDINJA
- && GetMonData(Shedinja, MON_DATA_LANGUAGE) == LANGUAGE_JAPANESE
+ GetSetPokedexFlag(SpeciesToNationalPokedexNum(evos[1].targetSpecies), FLAG_SET_SEEN);
+ GetSetPokedexFlag(SpeciesToNationalPokedexNum(evos[1].targetSpecies), FLAG_SET_CAUGHT);
+
+ if (GetMonData(shedinja, MON_DATA_SPECIES) == SPECIES_SHEDINJA
+ && GetMonData(shedinja, MON_DATA_LANGUAGE) == LANGUAGE_JAPANESE
&& GetMonData(mon, MON_DATA_SPECIES) == SPECIES_NINJASK)
- SetMonData(Shedinja, MON_DATA_NICKNAME, Text_ShedinjaJapaneseName);
+ SetMonData(shedinja, MON_DATA_NICKNAME, Text_ShedinjaJapaneseName);
}
}