about summary refs log tree commit diff stats
path: root/source
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2017-09-30 18:56:31 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2017-09-30 18:56:31 -0400
commita9c1db20aa6a46616b2c38e5dd391aa697f9110a (patch)
treee240047046c2b5161a722d93c1809708c5ecd01f /source
parentde39982228cc445fb02ca061e6484f7030104b7c (diff)
downloadgen3uploader-a9c1db20aa6a46616b2c38e5dd391aa697f9110a.tar.gz
gen3uploader-a9c1db20aa6a46616b2c38e5dd391aa697f9110a.tar.bz2
gen3uploader-a9c1db20aa6a46616b2c38e5dd391aa697f9110a.zip
Stopped sending "heldItem" if there is no hold item
Diffstat (limited to 'source')
-rw-r--r--source/deserialize.c11
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