Skip to content

Commit

Permalink
fix campaign_type for sp
Browse files Browse the repository at this point in the history
Previously, mp_game_utils.cpp::level_to_gamestate was setting campaign_type to multiplayer; this has been fixed.
Also, fixed some game loading code to adjust to the change.
  • Loading branch information
Rift-Walker committed Jul 13, 2014
1 parent c77be24 commit ba71022
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/mp_game_utils.cpp
Expand Up @@ -157,8 +157,9 @@ config initial_level_config(saved_game& state)

void level_to_gamestate(const config& level, saved_game& state)
{
game_classification::CAMPAIGN_TYPE type = state.classification().campaign_type;
state = saved_game(level);
state.classification().campaign_type = game_classification::MULTIPLAYER;
state.classification().campaign_type = type;
// Any replay data is only temporary and should be removed from
// the level data in case we want to save the game later.
if (const config& replay_data = level.child("replay"))
Expand Down
5 changes: 4 additions & 1 deletion src/saved_game.cpp
Expand Up @@ -199,7 +199,10 @@ void saved_game::expand_scenario()
{
resources::config_manager->load_game_config_for_game(this->classification());
const config& game_config = resources::config_manager->game_config();
const config& scenario = game_config.find_child(lexical_cast_default<std::string> (classification().campaign_type), "id", carryover_sides_start["next_scenario"]);
const config& scenario = game_config.find_child(lexical_cast_default<std::string>
(classification().campaign_type == game_classification::SCENARIO ?
game_classification::MULTIPLAYER : classification().campaign_type),
"id", carryover_sides_start["next_scenario"]);
if(scenario)
{
this->starting_pos_type_ = STARTINGPOS_SCENARIO;
Expand Down

0 comments on commit ba71022

Please sign in to comment.