diff options
Diffstat (limited to 'gba/source/serialize.c')
-rw-r--r-- | gba/source/serialize.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gba/source/serialize.c b/gba/source/serialize.c index 72afe2f..086e751 100644 --- a/gba/source/serialize.c +++ b/gba/source/serialize.c | |||
@@ -7,6 +7,9 @@ | |||
7 | #include "serialize.h" | 7 | #include "serialize.h" |
8 | #include "gamedata.h" | 8 | #include "gamedata.h" |
9 | #include "link.h" | 9 | #include "link.h" |
10 | #include "basestats.h" | ||
11 | #include "exptables.h" | ||
12 | #include "dexorder.h" | ||
10 | 13 | ||
11 | #define UNOWN_SPECIES_INDEX 201 | 14 | #define UNOWN_SPECIES_INDEX 201 |
12 | #define SHEDINJA_SPECIES_INDEX 303 | 15 | #define SHEDINJA_SPECIES_INDEX 303 |
@@ -60,7 +63,7 @@ void PokemonIntermediateInit( | |||
60 | struct PokemonSubstruct2* sub2 = GetBoxPokemonSubstruct2(bpkm); | 63 | struct PokemonSubstruct2* sub2 = GetBoxPokemonSubstruct2(bpkm); |
61 | struct PokemonSubstruct3* sub3 = GetBoxPokemonSubstruct3(bpkm); | 64 | struct PokemonSubstruct3* sub3 = GetBoxPokemonSubstruct3(bpkm); |
62 | 65 | ||
63 | struct BaseStats* baseStats = &gameData->baseStats[sub0->species]; | 66 | const struct SmallBaseStats* baseStats = &gSmallBaseStats[sub0->species]; |
64 | 67 | ||
65 | for (int i=0; i<POKEMON_NAME_LENGTH; i++) | 68 | for (int i=0; i<POKEMON_NAME_LENGTH; i++) |
66 | { | 69 | { |
@@ -74,7 +77,7 @@ void PokemonIntermediateInit( | |||
74 | 77 | ||
75 | pki->otId = bpkm->otId; | 78 | pki->otId = bpkm->otId; |
76 | pki->otGender = sub3->otGender; | 79 | pki->otGender = sub3->otGender; |
77 | pki->species = gameData->natOrder[sub0->species - 1]; | 80 | pki->species = gSpeciesToNationalPokedexNum[sub0->species - 1]; |
78 | pki->heldItem = sub0->heldItem; | 81 | pki->heldItem = sub0->heldItem; |
79 | pki->experience = sub0->experience; | 82 | pki->experience = sub0->experience; |
80 | 83 | ||
@@ -141,7 +144,7 @@ void PokemonIntermediateInit( | |||
141 | // Calculate level from experience. | 144 | // Calculate level from experience. |
142 | pki->level = 1; | 145 | pki->level = 1; |
143 | 146 | ||
144 | const u32* expTable = gameData->expTables[baseStats->growthRate]; | 147 | const u32* expTable = gExperienceTables[baseStats->growthRate]; |
145 | while ((pki->level <= 100) && (expTable[pki->level] <= sub0->experience)) | 148 | while ((pki->level <= 100) && (expTable[pki->level] <= sub0->experience)) |
146 | { | 149 | { |
147 | pki->level++; | 150 | pki->level++; |