mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-27 05:43:51 +01:00
[LEAK-INFORMED] fix CreateShedinja fakematch
info: the header change is required. accesses to the struct need to be treated as non-const, even though the array must be const. thanks to jiang for figuring this out.
This commit is contained in:
parent
2705f2e5f4
commit
2bbaf71998
@ -258,7 +258,6 @@ extern const u8 gFacilityClassToPicIndex[];
|
|||||||
extern const u8 gFacilityClassToTrainerClass[];
|
extern const u8 gFacilityClassToTrainerClass[];
|
||||||
extern const struct BaseStats gBaseStats[];
|
extern const struct BaseStats gBaseStats[];
|
||||||
extern const u8 *const gItemEffectTable[];
|
extern const u8 *const gItemEffectTable[];
|
||||||
extern const struct Evolution gEvolutionTable[][EVOS_PER_MON];
|
|
||||||
extern const u32 gExperienceTables[][MAX_LEVEL + 1];
|
extern const u32 gExperienceTables[][MAX_LEVEL + 1];
|
||||||
extern const u16 *const gLevelUpLearnsets[];
|
extern const u16 *const gLevelUpLearnsets[];
|
||||||
extern const u8 gPPUpGetMask[];
|
extern const u8 gPPUpGetMask[];
|
||||||
|
@ -23,6 +23,8 @@
|
|||||||
#include "constants/moves.h"
|
#include "constants/moves.h"
|
||||||
#include "constants/region_map_sections.h"
|
#include "constants/region_map_sections.h"
|
||||||
|
|
||||||
|
extern struct Evolution gEvolutionTable[][EVOS_PER_MON];
|
||||||
|
|
||||||
// this file's functions
|
// this file's functions
|
||||||
static void ClearDaycareMonMail(struct DaycareMail *mail);
|
static void ClearDaycareMonMail(struct DaycareMail *mail);
|
||||||
static void SetInitialEggData(struct Pokemon *mon, u16 species, struct DayCare *daycare);
|
static void SetInitialEggData(struct Pokemon *mon, u16 species, struct DayCare *daycare);
|
||||||
|
@ -34,6 +34,8 @@
|
|||||||
#include "constants/rgb.h"
|
#include "constants/rgb.h"
|
||||||
#include "constants/items.h"
|
#include "constants/items.h"
|
||||||
|
|
||||||
|
extern struct Evolution gEvolutionTable[][EVOS_PER_MON];
|
||||||
|
|
||||||
struct EvoInfo
|
struct EvoInfo
|
||||||
{
|
{
|
||||||
u8 preEvoSpriteId;
|
u8 preEvoSpriteId;
|
||||||
@ -550,8 +552,6 @@ static void CreateShedinja(u16 preEvoSpecies, struct Pokemon* mon)
|
|||||||
{
|
{
|
||||||
s32 i;
|
s32 i;
|
||||||
struct Pokemon* shedinja = &gPlayerParty[gPlayerPartyCount];
|
struct Pokemon* shedinja = &gPlayerParty[gPlayerPartyCount];
|
||||||
const struct Evolution *evos;
|
|
||||||
const struct Evolution *evos2;
|
|
||||||
|
|
||||||
CopyMon(&gPlayerParty[gPlayerPartyCount], mon, sizeof(struct Pokemon));
|
CopyMon(&gPlayerParty[gPlayerPartyCount], mon, sizeof(struct Pokemon));
|
||||||
SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_SPECIES, &gEvolutionTable[preEvoSpecies][1].targetSpecies);
|
SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_SPECIES, &gEvolutionTable[preEvoSpecies][1].targetSpecies);
|
||||||
@ -572,12 +572,8 @@ static void CreateShedinja(u16 preEvoSpecies, struct Pokemon* mon)
|
|||||||
CalculateMonStats(&gPlayerParty[gPlayerPartyCount]);
|
CalculateMonStats(&gPlayerParty[gPlayerPartyCount]);
|
||||||
CalculatePlayerPartyCount();
|
CalculatePlayerPartyCount();
|
||||||
|
|
||||||
// can't match it otherwise, ehh
|
GetSetPokedexFlag(SpeciesToNationalPokedexNum(gEvolutionTable[preEvoSpecies][1].targetSpecies), FLAG_SET_SEEN);
|
||||||
evos2 = gEvolutionTable[0];
|
GetSetPokedexFlag(SpeciesToNationalPokedexNum(gEvolutionTable[preEvoSpecies][1].targetSpecies), FLAG_SET_CAUGHT);
|
||||||
evos = evos2 + EVOS_PER_MON * preEvoSpecies;
|
|
||||||
|
|
||||||
GetSetPokedexFlag(SpeciesToNationalPokedexNum(evos[1].targetSpecies), FLAG_SET_SEEN);
|
|
||||||
GetSetPokedexFlag(SpeciesToNationalPokedexNum(evos[1].targetSpecies), FLAG_SET_CAUGHT);
|
|
||||||
|
|
||||||
if (GetMonData(shedinja, MON_DATA_SPECIES) == SPECIES_SHEDINJA
|
if (GetMonData(shedinja, MON_DATA_SPECIES) == SPECIES_SHEDINJA
|
||||||
&& GetMonData(shedinja, MON_DATA_LANGUAGE) == LANGUAGE_JAPANESE
|
&& GetMonData(shedinja, MON_DATA_LANGUAGE) == LANGUAGE_JAPANESE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user