Don't save star systems that don't have any missions.
This commit is contained in:
parent
4a2908cf6e
commit
eb225fefc9
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue