Skip to content

Commit

Permalink
Fix save on mission close' container (#5463)
Browse files Browse the repository at this point in the history
  • Loading branch information
jg18 authored Jun 21, 2023
1 parent 8c23762 commit 4fa5c0d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 6 additions & 2 deletions code/mission/missioncampaign.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,9 @@ int mission_campaign_previous_mission()
}

// copy backed up containers over
Campaign.persistent_containers = Campaign.red_alert_containers;
for (const auto& ra_container : Campaign.red_alert_containers) {
Campaign.persistent_containers.emplace_back(ra_container);
}

Pilot.save_savefile();

Expand Down Expand Up @@ -1056,7 +1058,9 @@ void mission_campaign_store_containers(ContainerType persistence_type, bool stor
}

if (store_red_alert) {
Campaign.persistent_containers = Campaign.red_alert_containers;
for (const auto& current_con : Campaign.red_alert_containers) {
Campaign.persistent_containers.emplace_back(current_con);
}
}

for (const auto &container : get_all_sexp_containers()) {
Expand Down
4 changes: 4 additions & 0 deletions code/pilotfile/csg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1511,6 +1511,10 @@ void pilotfile::csg_reset_data()
Campaign.persistent_variables.clear();
Campaign.red_alert_variables.clear();

// clear out containers
Campaign.persistent_containers.clear();
Campaign.red_alert_containers.clear();

// clear red alert data
Red_alert_wingman_status.clear();

Expand Down

0 comments on commit 4fa5c0d

Please sign in to comment.