Skip to content

Commit

Permalink
don't generate [side]s if the [multiplayer] has at least one [side] d…
Browse files Browse the repository at this point in the history
…efined.

fixes one part of #2604
  • Loading branch information
gfgtdf authored and jyrkive committed Mar 9, 2018
1 parent 471c9e8 commit 9e82200
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/game_initialization/create_engine.cpp
Expand Up @@ -106,12 +106,14 @@ void scenario::set_sides()
// starting positions, then generate the additional sides
const int map_positions = map_->num_valid_starting_positions();

for(int pos = data_.child_count("side"); pos < map_positions; ++pos) {
config& side = data_.add_child("side");
side["side"] = pos + 1;
side["team_name"] = "Team " + std::to_string(pos + 1);
side["canrecruit"] = true;
side["controller"] = "human";
if(!data_.has_child("side")) {
for(int pos = 0; pos < map_positions; ++pos) {
config& side = data_.add_child("side");
side["side"] = pos + 1;
side["team_name"] = "Team " + std::to_string(pos + 1);
side["canrecruit"] = true;
side["controller"] = "human";
}
}

num_players_ = 0;
Expand Down

0 comments on commit 9e82200

Please sign in to comment.