From a9c1db20aa6a46616b2c38e5dd391aa697f9110a Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sat, 30 Sep 2017 18:56:31 -0400 Subject: Stopped sending "heldItem" if there is no hold item --- source/deserialize.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/source/deserialize.c b/source/deserialize.c index b37cb72..b9b1613 100644 --- a/source/deserialize.c +++ b/source/deserialize.c @@ -125,10 +125,13 @@ cJSON* pokemonToJson(const struct PokemonIntermediate* pki) "experience", __builtin_bswap32(pki->experience)); - cJSON_AddNumberToObject( - jPoke, - "heldItem", - __builtin_bswap16(pki->heldItem)); + if (pki->heldItem) + { + cJSON_AddNumberToObject( + jPoke, + "heldItem", + __builtin_bswap16(pki->heldItem)); + } cJSON* jMoves = cJSON_CreateArray(); -- cgit 1.4.1