diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-09-30 18:56:31 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-09-30 18:56:31 -0400 |
commit | a9c1db20aa6a46616b2c38e5dd391aa697f9110a (patch) | |
tree | e240047046c2b5161a722d93c1809708c5ecd01f /source/deserialize.c | |
parent | de39982228cc445fb02ca061e6484f7030104b7c (diff) | |
download | gen3uploader-a9c1db20aa6a46616b2c38e5dd391aa697f9110a.tar.gz gen3uploader-a9c1db20aa6a46616b2c38e5dd391aa697f9110a.tar.bz2 gen3uploader-a9c1db20aa6a46616b2c38e5dd391aa697f9110a.zip |
Stopped sending "heldItem" if there is no hold item
Diffstat (limited to 'source/deserialize.c')
-rw-r--r-- | source/deserialize.c | 11 |
1 files 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) | |||
125 | "experience", | 125 | "experience", |
126 | __builtin_bswap32(pki->experience)); | 126 | __builtin_bswap32(pki->experience)); |
127 | 127 | ||
128 | cJSON_AddNumberToObject( | 128 | if (pki->heldItem) |
129 | jPoke, | 129 | { |
130 | "heldItem", | 130 | cJSON_AddNumberToObject( |
131 | __builtin_bswap16(pki->heldItem)); | 131 | jPoke, |
132 | "heldItem", | ||
133 | __builtin_bswap16(pki->heldItem)); | ||
134 | } | ||
132 | 135 | ||
133 | cJSON* jMoves = cJSON_CreateArray(); | 136 | cJSON* jMoves = cJSON_CreateArray(); |
134 | 137 | ||