Save Bob's x,y as ints.

This commit is contained in:
Steve 2018-02-11 11:08:21 +00:00
parent 9fdcf042ca
commit 43ef8079fc
1 changed files with 3 additions and 2 deletions

View File

@ -59,6 +59,7 @@ Entity *initBob(void)
initEntity((Entity*)b);
STRNCPY(b->name, "Bob", MAX_NAME_LENGTH);
b->type = ET_BOB;
walkSprite[FACING_LEFT] = getSprite("BobLeft");
@ -669,7 +670,7 @@ static void load(cJSON *root)
static void save(cJSON *root)
{
cJSON_AddStringToObject(root, "type", "Bob");
cJSON_AddNumberToObject(root, "x", world.bob->x);
cJSON_AddNumberToObject(root, "y", world.bob->y);
cJSON_AddNumberToObject(root, "x", (int)world.bob->x);
cJSON_AddNumberToObject(root, "y", (int)world.bob->y);
cJSON_AddStringToObject(root, "facing", getLookupName("FACING_", world.bob->facing));
}