From 4be9c4dadc54197eedded43825995dec9f524cfc Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Wed, 4 Oct 2017 22:49:41 -0400 Subject: Added sending pokeball and Orre flag --- source/deserialize.c | 26 ++++++++++++++++++-------- 1 file 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) cJSON_AddStringToObject(jPoke, "otGender", "male"); } - cJSON_AddNumberToObject( - jPoke, - "metLevel", - pki->metLevel); + if (pki->orre) + { + cJSON_AddBoolToObject(jPoke, "orre", true); + } else { + cJSON_AddNumberToObject( + jPoke, + "metLevel", + pki->metLevel); - cJSON_AddNumberToObject( - jPoke, - "metLocation", - pki->metLocation); + cJSON_AddNumberToObject( + jPoke, + "metLocation", + pki->metLocation); + } cJSON_AddBoolToObject( jPoke, @@ -205,6 +210,11 @@ cJSON* pokemonToJson(const struct PokemonIntermediate* pki) "secondAbility", pki->altAbility); + cJSON_AddNumberToObject( + jPoke, + "pokeball", + pki->pokeball); + // Handle Unown form. if (__builtin_bswap16(pki->species) == 201) { -- cgit 1.4.1