diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-09-23 10:21:57 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-09-23 10:21:57 -0400 |
commit | 6437a6cd49404b5e2e83bf940d8ac2284eb1e6bf (patch) | |
tree | 99bc9420d2817f78e3ca7f91db12ab085d5b051c /gba/source/serialize.c | |
parent | eeaa6c5fd4957b6719fcb9f76cef5f9931237891 (diff) | |
download | gen3uploader-6437a6cd49404b5e2e83bf940d8ac2284eb1e6bf.tar.gz gen3uploader-6437a6cd49404b5e2e83bf940d8ac2284eb1e6bf.tar.bz2 gen3uploader-6437a6cd49404b5e2e83bf940d8ac2284eb1e6bf.zip |
Fixed shininess determination
Shininess is determined with the ID of the OT, not the game the Pokémon is currently in.
Diffstat (limited to 'gba/source/serialize.c')
-rw-r--r-- | gba/source/serialize.c | 12 |
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 | ||
42 | void PokemonIntermediateInit( | 42 | void 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) |