If Bob was stunned when the game is saving, set him back to normal facing so we don't error.

This commit is contained in:
Steve 2018-04-25 08:17:49 +01:00
parent 9c1b39179d
commit ceaced512f
1 changed files with 6 additions and 0 deletions

View File

@ -709,6 +709,12 @@ static void load(cJSON *root)
static void save(cJSON *root)
{
/* in case Bob was put into stun state during save */
if (world.bob->facing == FACING_DIE)
{
world.bob->facing = oldFacing;
}
cJSON_AddStringToObject(root, "type", "Bob");
cJSON_AddNumberToObject(root, "x", world.bob->checkpoints[0].x);
cJSON_AddNumberToObject(root, "y", world.bob->checkpoints[0].y);