Apply changes from mp::connect in between MP campaign's scenarios.
The mp::connect is now shown only with '--debug' option. This avoids multiple factions being applied to the same side over multiple scenarios.
This commit is contained in:
parent
2d75c8f000
commit
298e6f8ede
3 changed files with 15 additions and 4 deletions
|
@ -900,7 +900,7 @@ void start_client(game_display& disp, const config& game_config,
|
|||
}
|
||||
}
|
||||
|
||||
void goto_mp_connect(game_display& disp, const config& game_config,
|
||||
game_state goto_mp_connect(game_display& disp, const config& game_config,
|
||||
const mp_game_settings& params)
|
||||
{
|
||||
mp::ui::result res;
|
||||
|
@ -931,6 +931,7 @@ void goto_mp_connect(game_display& disp, const config& game_config,
|
|||
break;
|
||||
}
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ void start_local_game_commandline(game_display& disp, const config& game_config,
|
|||
void start_client(game_display& disp, const config& game_config,
|
||||
const std::string& host);
|
||||
|
||||
void goto_mp_connect(game_display& disp, const config& game_config,
|
||||
game_state goto_mp_connect(game_display& disp, const config& game_config,
|
||||
const mp_game_settings& params);
|
||||
|
||||
}
|
||||
|
|
|
@ -612,9 +612,19 @@ LEVEL_RESULT play_game(game_display& disp, game_state& gamestate,
|
|||
}
|
||||
|
||||
if(io_type == IO_SERVER && scenario != NULL) {
|
||||
if (local_mp_game) {
|
||||
if (local_mp_game && game_config::debug) {
|
||||
config old_carryover_sides_start =
|
||||
gamestate.carryover_sides_start;
|
||||
gamestate.mp_settings().scenario_data = *scenario;
|
||||
mp::goto_mp_connect(disp, game_config, gamestate.mp_settings());
|
||||
|
||||
// Opens mp::connect dialog to get a new gamestate.
|
||||
// Old carryover data is preserved.
|
||||
gamestate = mp::goto_mp_connect(disp, game_config, gamestate.mp_settings());
|
||||
gamestate.carryover_sides_start.merge_with(
|
||||
old_carryover_sides_start);
|
||||
|
||||
starting_pos.merge_with(gamestate.replay_start());
|
||||
scenario = &starting_pos;
|
||||
}
|
||||
|
||||
// Tweaks sides to adapt controllers and descriptions.
|
||||
|
|
Loading…
Add table
Reference in a new issue