about summary refs log tree commit diff stats
path: root/gba/source/serialize.c
diff options
context:
space:
mode:
Diffstat (limited to 'gba/source/serialize.c')
-rw-r--r--gba/source/serialize.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/gba/source/serialize.c b/gba/source/serialize.c index d08dfc2..8929689 100644 --- a/gba/source/serialize.c +++ b/gba/source/serialize.c
@@ -41,9 +41,7 @@ u32 CalculateStat(
41 41
42void PokemonIntermediateInit( 42void PokemonIntermediateInit(
43 struct PokemonIntermediate* pki, 43 struct PokemonIntermediate* pki,
44 struct BoxPokemon* bpkm, 44 struct BoxPokemon* bpkm)
45 u16 trainerId,
46 u16 secretId)
47{ 45{
48 DecryptBoxPokemon(bpkm); 46 DecryptBoxPokemon(bpkm);
49 47
@@ -120,10 +118,10 @@ void PokemonIntermediateInit(
120 } 118 }
121 119
122 // Determine shininess from the personality value. 120 // Determine shininess from the personality value.
123 u16 shinyDeterminer = 121 u32 shinyDeterminer =
124 (trainerId) 122 ((bpkm->otId & 0xFFFF0000) >> 16)
125 ^ (secretId) 123 ^ (bpkm->otId & 0x0000FFFF)
126 ^ ((bpkm->personality >> 16) & 0x0000FFFF) 124 ^ ((bpkm->personality & 0xFFFF0000) >> 16)
127 ^ (bpkm->personality & 0x0000FFFF); 125 ^ (bpkm->personality & 0x0000FFFF);
128 126
129 if (shinyDeterminer < 8) 127 if (shinyDeterminer < 8)