From 6437a6cd49404b5e2e83bf940d8ac2284eb1e6bf Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sat, 23 Sep 2017 10:21:57 -0400 Subject: Fixed shininess determination MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Shininess is determined with the ID of the OT, not the game the Pokémon is currently in. --- gba/source/serialize.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'gba/source/serialize.c') 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( void PokemonIntermediateInit( struct PokemonIntermediate* pki, - struct BoxPokemon* bpkm, - u16 trainerId, - u16 secretId) + struct BoxPokemon* bpkm) { DecryptBoxPokemon(bpkm); @@ -120,10 +118,10 @@ void PokemonIntermediateInit( } // Determine shininess from the personality value. - u16 shinyDeterminer = - (trainerId) - ^ (secretId) - ^ ((bpkm->personality >> 16) & 0x0000FFFF) + u32 shinyDeterminer = + ((bpkm->otId & 0xFFFF0000) >> 16) + ^ (bpkm->otId & 0x0000FFFF) + ^ ((bpkm->personality & 0xFFFF0000) >> 16) ^ (bpkm->personality & 0x0000FFFF); if (shinyDeterminer < 8) -- cgit 1.4.1