fix campaign_type for sp
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.
This commit is contained in:
parent
c77be2489f
commit
ba71022027
2 changed files with 6 additions and 2 deletions
|
@ -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"))
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue