diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-10-04 22:49:41 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-10-04 22:49:41 -0400 |
commit | 4be9c4dadc54197eedded43825995dec9f524cfc (patch) | |
tree | c3c54971f3d35bb195601d9d589344de8d982582 /source | |
parent | 9842caa5b6e56af78c0bd875b2dc33fb77f2bb36 (diff) | |
download | gen3uploader-4be9c4dadc54197eedded43825995dec9f524cfc.tar.gz gen3uploader-4be9c4dadc54197eedded43825995dec9f524cfc.tar.bz2 gen3uploader-4be9c4dadc54197eedded43825995dec9f524cfc.zip |
Added sending pokeball and Orre flag
Diffstat (limited to 'source')
-rw-r--r-- | source/deserialize.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/source/deserialize.c b/source/deserialize.c index b9b1613..6b6ea55 100644 --- a/source/deserialize.c +++ b/source/deserialize.c | |||
@@ -169,15 +169,20 @@ cJSON* pokemonToJson(const struct PokemonIntermediate* pki) | |||
169 | cJSON_AddStringToObject(jPoke, "otGender", "male"); | 169 | cJSON_AddStringToObject(jPoke, "otGender", "male"); |
170 | } | 170 | } |
171 | 171 | ||
172 | cJSON_AddNumberToObject( | 172 | if (pki->orre) |
173 | jPoke, | 173 | { |
174 | "metLevel", | 174 | cJSON_AddBoolToObject(jPoke, "orre", true); |
175 | pki->metLevel); | 175 | } else { |
176 | cJSON_AddNumberToObject( | ||
177 | jPoke, | ||
178 | "metLevel", | ||
179 | pki->metLevel); | ||
176 | 180 | ||
177 | cJSON_AddNumberToObject( | 181 | cJSON_AddNumberToObject( |
178 | jPoke, | 182 | jPoke, |
179 | "metLocation", | 183 | "metLocation", |
180 | pki->metLocation); | 184 | pki->metLocation); |
185 | } | ||
181 | 186 | ||
182 | cJSON_AddBoolToObject( | 187 | cJSON_AddBoolToObject( |
183 | jPoke, | 188 | jPoke, |
@@ -205,6 +210,11 @@ cJSON* pokemonToJson(const struct PokemonIntermediate* pki) | |||
205 | "secondAbility", | 210 | "secondAbility", |
206 | pki->altAbility); | 211 | pki->altAbility); |
207 | 212 | ||
213 | cJSON_AddNumberToObject( | ||
214 | jPoke, | ||
215 | "pokeball", | ||
216 | pki->pokeball); | ||
217 | |||
208 | // Handle Unown form. | 218 | // Handle Unown form. |
209 | if (__builtin_bswap16(pki->species) == 201) | 219 | if (__builtin_bswap16(pki->species) == 201) |
210 | { | 220 | { |