Skip to content

Commit

Permalink
Implemented gui-less mp_connect for sp
Browse files Browse the repository at this point in the history
Also, made sides with blank controllers default to ai in sp.
  • Loading branch information
Rift-Walker committed Jul 13, 2014
1 parent 2bb5073 commit 73a722e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/multiplayer.cpp
Expand Up @@ -489,6 +489,7 @@ static bool enter_connect_mode(game_display& disp, const config& game_config,
gamelist.clear();
statistics::fresh_stats();

if (state.classification().campaign_type == game_classification::MULTIPLAYER)
{
mp::connect_engine_ptr connect_engine(new mp::connect_engine(state, local_players_only, true));
mp::connect ui(disp, state.mp_settings().name, game_config, gamechat, gamelist,
Expand All @@ -502,6 +503,11 @@ static bool enter_connect_mode(game_display& disp, const config& game_config,
if (res == mp::ui::PLAY) {
ui.start_game();
}
} // end connect_engine_ptr scope
else {
mp::connect_engine engine(state, local_players_only, true);
engine.start_game();
res = mp::ui::PLAY;
}

switch (res) {
Expand Down
1 change: 1 addition & 0 deletions src/multiplayer_connect_engine.cpp
Expand Up @@ -856,6 +856,7 @@ side_engine::side_engine(const config& cfg, connect_engine& parent_engine,
// Tweak the controllers.
if (cfg_["controller"] == "human_ai" ||
cfg_["controller"] == "network_ai" ||
(parent_.state_.classification().campaign_type == game_classification::SCENARIO && cfg_["controller"].blank()) ||
(cfg_["controller"] == "network" && !allow_player_ && parent_.params_.saved_game)) { //this is a workaround for bug #21797

cfg_["controller"] = "ai";
Expand Down

0 comments on commit 73a722e

Please sign in to comment.