diff options
-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 | ||