Skip to content

Commit

Permalink
In [leader_goal], never set facet ID to * or a number
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel authored and mattsc committed Mar 22, 2016
1 parent e2ea9cd commit b0b02d6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/ai/configuration.cpp
Expand Up @@ -309,9 +309,12 @@ void configuration::expand_simplified_aspects(side_number side, config &cfg) {
facet_config["turns"] = turns;
facet_config["time_of_day"] = time_of_day;
facet_config.add_child("value", child.cfg);
if (child.key == "leader_goal") {
if (child.key == "leader_goal" && !child.cfg["id"].empty()) {
// Use id= attribute (if present) as the facet ID
facet_config["id"] = child.cfg["id"];
const std::string& id = child.cfg["id"];
if(id != "*" && id.find_first_not_of("0123456789") != std::string::npos) {
facet_config["id"] = child.cfg["id"];
}
}
facet_configs.push_back(std::make_pair(child.key, facet_config));
}
Expand Down

0 comments on commit b0b02d6

Please sign in to comment.