Skip to content

Commit

Permalink
Connect Engine: fixup 95b2d8c
Browse files Browse the repository at this point in the history
Turns out the proper value for type= in the case of an Empty controller is "null". Will need to change this since
arbitrary string flags like this are absurd and make the code more complicated.
  • Loading branch information
Vultraz committed Feb 26, 2017
1 parent fe6c5ef commit 14c9ed4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/game_initialization/connect_engine.cpp
Expand Up @@ -1085,12 +1085,14 @@ config side_engine::new_config() const
}
}

// NOTE: the presence of a type= key overrides no_leader. no_leader can be set by the
// controller being set to CNTR_EMPTY, but to be safe we check the key specifically
// here in case it was somehow included in the side config.
if(!(*leader)["no_leader"].to_bool(false)) {
// NOTE: the presence of a type= key overrides no_leader
if(controller_ != CNTR_EMPTY) {
(*leader)["type"] = flg_.current_leader();
(*leader)["gender"] = flg_.current_gender();
} else {
// TODO: FIX THIS SHIT! We shouldn't have a special string to denote no-leader-ness...
(*leader)["type"] = "null";
(*leader)["gender"] = "null";
}

res["team_name"] = parent_.team_names_[team_];
Expand Down

0 comments on commit 14c9ed4

Please sign in to comment.