about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2017-09-24 14:11:00 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2017-09-24 14:11:00 -0400
commitb9b9f7c0ca3824c670d525e4c46e52cd72f3a8d3 (patch)
tree7fb8f741a4070e4b3b5ea9618c60750783e348bb
parent34e22f57f04180d71772f192dad32df6e82fbe6d (diff)
downloadgen3uploader-b9b9f7c0ca3824c670d525e4c46e52cd72f3a8d3.tar.gz
gen3uploader-b9b9f7c0ca3824c670d525e4c46e52cd72f3a8d3.tar.bz2
gen3uploader-b9b9f7c0ca3824c670d525e4c46e52cd72f3a8d3.zip
Fixed Unown form determination
-rw-r--r--gba/source/serialize.c8
-rw-r--r--source/deserialize.c2
2 files changed, 5 insertions, 5 deletions
diff --git a/gba/source/serialize.c b/gba/source/serialize.c index 8929689..f5446ef 100644 --- a/gba/source/serialize.c +++ b/gba/source/serialize.c
@@ -135,10 +135,10 @@ void PokemonIntermediateInit(
135 if (sub0->species == UNOWN_SPECIES_INDEX) 135 if (sub0->species == UNOWN_SPECIES_INDEX)
136 { 136 {
137 u8 unownDeterminer = 137 u8 unownDeterminer =
138 ((bpkm->personality & 0x07000000) >> 18) 138 ((bpkm->personality & 0x03000000) >> 18)
139 | ((bpkm->personality & 0x00070000) >> 12) 139 | ((bpkm->personality & 0x00030000) >> 12)
140 | ((bpkm->personality & 0x00000700) >> 6) 140 | ((bpkm->personality & 0x00000300) >> 6)
141 | (bpkm->personality & 0x00000007); 141 | (bpkm->personality & 0x00000003);
142 142
143 pki->unownLetter = (unownDeterminer % 28); 143 pki->unownLetter = (unownDeterminer % 28);
144 } 144 }
diff --git a/source/deserialize.c b/source/deserialize.c index e6fdf3b..da2d919 100644 --- a/source/deserialize.c +++ b/source/deserialize.c
@@ -203,7 +203,7 @@ cJSON* pokemonToJson(const struct PokemonIntermediate* pki)
203 pki->altAbility); 203 pki->altAbility);
204 204
205 // Handle Unown form. 205 // Handle Unown form.
206 if (pki->species == 201) 206 if (__builtin_bswap16(pki->species) == 201)
207 { 207 {
208 cJSON_AddNumberToObject( 208 cJSON_AddNumberToObject(
209 jPoke, 209 jPoke,