From 6c980d12dcd56ccd16ff8b7150cd15ef19f0a821 Mon Sep 17 00:00:00 2001 From: Pentarctagon Date: Thu, 18 Feb 2021 23:35:21 -0600 Subject: [PATCH] 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. --- src/game_initialization/playcampaign.cpp | 5 ++++- src/saved_game.cpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/game_initialization/playcampaign.cpp b/src/game_initialization/playcampaign.cpp index f60ffe7a49b2..3da78e4111c9 100644 --- a/src/game_initialization/playcampaign.cpp +++ b/src/game_initialization/playcampaign.cpp @@ -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(); diff --git a/src/saved_game.cpp b/src/saved_game.cpp index e3f1e66e8fd5..55f93ba66b04 100644 --- a/src/saved_game.cpp +++ b/src/saved_game.cpp @@ -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); }