about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--source/deserialize.c26
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 {