Don't save star systems that don't have any missions.

This commit is contained in:
Steve 2016-05-04 10:27:16 +01:00
parent 4a2908cf6e
commit eb225fefc9
1 changed files with 8 additions and 5 deletions

View File

@ -63,6 +63,8 @@ static void saveStarSystems(cJSON *gameJSON)
starSystemsJSON = cJSON_CreateArray();
for (starSystem = game.starSystemHead.next ; starSystem != NULL ; starSystem = starSystem->next)
{
if (starSystem->totalMissions > 0)
{
starSystemJSON = cJSON_CreateObject();
@ -72,6 +74,7 @@ static void saveStarSystems(cJSON *gameJSON)
cJSON_AddItemToArray(starSystemsJSON, starSystemJSON);
}
}
cJSON_AddItemToObject(gameJSON, "starSystems", starSystemsJSON);
}