Save Bob's x,y as ints.
This commit is contained in:
parent
9fdcf042ca
commit
43ef8079fc
|
@ -59,6 +59,7 @@ Entity *initBob(void)
|
||||||
|
|
||||||
initEntity((Entity*)b);
|
initEntity((Entity*)b);
|
||||||
|
|
||||||
|
STRNCPY(b->name, "Bob", MAX_NAME_LENGTH);
|
||||||
b->type = ET_BOB;
|
b->type = ET_BOB;
|
||||||
|
|
||||||
walkSprite[FACING_LEFT] = getSprite("BobLeft");
|
walkSprite[FACING_LEFT] = getSprite("BobLeft");
|
||||||
|
@ -669,7 +670,7 @@ static void load(cJSON *root)
|
||||||
static void save(cJSON *root)
|
static void save(cJSON *root)
|
||||||
{
|
{
|
||||||
cJSON_AddStringToObject(root, "type", "Bob");
|
cJSON_AddStringToObject(root, "type", "Bob");
|
||||||
cJSON_AddNumberToObject(root, "x", world.bob->x);
|
cJSON_AddNumberToObject(root, "x", (int)world.bob->x);
|
||||||
cJSON_AddNumberToObject(root, "y", world.bob->y);
|
cJSON_AddNumberToObject(root, "y", (int)world.bob->y);
|
||||||
cJSON_AddStringToObject(root, "facing", getLookupName("FACING_", world.bob->facing));
|
cJSON_AddStringToObject(root, "facing", getLookupName("FACING_", world.bob->facing));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue