Clear the list of scenario content before getting the next list of content.

Otherwise each scenario keeps appending additional and usually duplicate content being sent to the server.
This commit is contained in:
Pentarctagon 2021-02-18 23:35:21 -06:00 committed by Pentarctagon
parent 387f4ae448
commit 6c980d12dc
2 changed files with 5 additions and 2 deletions

View file

@ -361,8 +361,11 @@ LEVEL_RESULT campaign_controller::play_game()
return LEVEL_RESULT::QUIT;
}
// The host should send the complete savegame now that also contains the carryvoer sides start.
// The host should send the complete savegame now that also contains the carryover sides start.
} else {
// clear previous game content information
// otherwise it keeps getting appended for each scenario resulting in incorrect data being sent to the server to be stored
state_.mp_settings().addons.clear();
// Retrieve next scenario data.
state_.expand_scenario();

View file

@ -380,7 +380,7 @@ void saved_game::expand_mp_events()
);
// We don't want the error message below if there is no era (= if this is a sp game).
if(!classification_.era_id .empty()) {
if(!classification_.era_id.empty()) {
mods.emplace_back("era", classification_.era_id);
}