Skip to content

Commit

Permalink
Game Config: fixup color_info not parsing the color range correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Vultraz committed Dec 3, 2016
1 parent 44f8d2e commit cc5071f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/game_config.cpp
Expand Up @@ -477,10 +477,12 @@ const color_range& color_info(const std::string& name)
}

std::vector<color_t> temp;
try {
temp.push_back(color_t::from_hex_string(name));
} catch(std::invalid_argument& e) {
throw config::error(_("Invalid color range: ") + name);
for(const auto& s : utils::split(name)) {
try {
temp.push_back(color_t::from_hex_string(s));
} catch(std::invalid_argument& e) {
throw config::error(_("Invalid color in range: ") + s);
}
}

team_rgb_range.insert({name, color_range(temp)});
Expand Down

0 comments on commit cc5071f

Please sign in to comment.