summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGriffinR <griffin.g.richards@gmail.com>2021-06-02 16:38:03 -0400
committerGitHub <noreply@github.com>2021-06-02 16:38:03 -0400
commit753b19d0ea79b9637c0eb08b3f1b04b543fe90a0 (patch)
tree20f199f8ceb2929275a6243425d77ce6663f35d7 /src
parent89ce873a73b586b3b7a23512ae8a176af30274ca (diff)
parentc9ef0d1b7ae8cc68b4ef832f4a3c1f9cd85f716d (diff)
Merge pull request #435 from Kurausukun/dumb
[LEAK-INFORMED] Fix CreateShedinja Fakematch
Diffstat (limited to 'src')
-rw-r--r--src/daycare.c2
-rw-r--r--src/evolution_scene.c12
2 files changed, 6 insertions, 8 deletions
diff --git a/src/daycare.c b/src/daycare.c
index 97190c1d6..1c3f24ba3 100644
--- a/src/daycare.c
+++ b/src/daycare.c
@@ -32,6 +32,8 @@
// Combination of RSE's Day-Care (re-used on Four Island), FRLG's Day-Care, and egg_hatch.c
+extern const struct Evolution gEvolutionTable[][EVOS_PER_MON];
+
struct EggHatchData
{
u8 eggSpriteID;
diff --git a/src/evolution_scene.c b/src/evolution_scene.c
index 0eb36b523..ffbec26ba 100644
--- a/src/evolution_scene.c
+++ b/src/evolution_scene.c
@@ -26,6 +26,8 @@
#include "constants/songs.h"
#include "constants/pokemon.h"
+extern struct Evolution gEvolutionTable[][EVOS_PER_MON];
+
struct EvoInfo
{
u8 preEvoSpriteId;
@@ -545,8 +547,6 @@ static void CreateShedinja(u16 preEvoSpecies, struct Pokemon* mon)
{
s32 i;
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][1].targetSpecies));
@@ -567,12 +567,8 @@ static void CreateShedinja(u16 preEvoSpecies, struct Pokemon* mon)
CalculateMonStats(&gPlayerParty[gPlayerPartyCount]);
CalculatePlayerPartyCount();
- // can't match it otherwise, ehh
- evos2 = gEvolutionTable[0];
- evos = evos2 + EVOS_PER_MON * preEvoSpecies;
-
- GetSetPokedexFlag(SpeciesToNationalPokedexNum(evos[1].targetSpecies), FLAG_SET_SEEN);
- GetSetPokedexFlag(SpeciesToNationalPokedexNum(evos[1].targetSpecies), FLAG_SET_CAUGHT);
+ GetSetPokedexFlag(SpeciesToNationalPokedexNum(gEvolutionTable[preEvoSpecies][1].targetSpecies), FLAG_SET_SEEN);
+ GetSetPokedexFlag(SpeciesToNationalPokedexNum(gEvolutionTable[preEvoSpecies][1].targetSpecies), FLAG_SET_CAUGHT);
if (GetMonData(shedinja, MON_DATA_SPECIES) == SPECIES_SHEDINJA
&& GetMonData(shedinja, MON_DATA_LANGUAGE) == LANGUAGE_JAPANESE