Skip to content

Commit

Permalink
attempt to fix assertion in connect_engine
Browse files Browse the repository at this point in the history
  • Loading branch information
gfgtdf committed Apr 14, 2017
1 parent ed1aa0d commit 1adeb98
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/game_initialization/connect_engine.cpp
Expand Up @@ -901,18 +901,18 @@ side_engine::side_engine(const config& cfg, connect_engine& parent_engine, const
cfg_["save_id"] = parent_.scenario()["id"].str() + "_" + std::to_string(index);
}

if(cfg_["controller"] != "human" && cfg_["controller"] != "ai" && cfg_["controller"] != "null") {
//an invalid contoller type was specified. Remove it to prevent asertion failures later.
cfg_.remove_attribute("controller");
}

update_controller_options();

// Tweak the controllers.
if(parent_.state_.classification().campaign_type == game_classification::CAMPAIGN_TYPE::SCENARIO && cfg_["controller"].blank()) {
cfg_["controller"] = "ai";
}

if(cfg_["controller"] != "human" && cfg_["controller"] != "ai" && cfg_["controller"] != "null") {
//an invalid contoller type was specified. Remove it to prevent asertion failures later.
cfg_.remove_attribute("controller");
}

if(cfg_["controller"] == "null") {
set_controller(CNTR_EMPTY);
} else if(cfg_["controller"] == "ai") {
Expand Down

0 comments on commit 1adeb98

Please sign in to comment.