Skip to content

Commit

Permalink
Fixup ff5d68f (fixes #2125)
Browse files Browse the repository at this point in the history
Also contains a minor fixup of db8891f (sign type mismatch warning fix).

For some reason, the use of the side-1 fallback in the to_unsigned() calls was making every
side get assigned the color red... Sadly, this means an saved games created in the past 12
hours or so have broken color data. Oh well.
  • Loading branch information
Vultraz authored and GregoryLundberg committed Nov 30, 2017
1 parent 3b2ab9b commit 370763e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/team.cpp
Expand Up @@ -874,7 +874,7 @@ void team::shroud_map::read(const std::string& str)
void team::shroud_map::merge(const std::string& str)
{
int x = 0, y = 0;
for(int i = 1; i < str.length(); ++i) {
for(size_t i = 1; i < str.length(); ++i) {
if(str[i] == '|') {
y = 0;
x++;
Expand Down Expand Up @@ -971,11 +971,11 @@ std::string team::get_side_color_id_from_config(const config& cfg)
// If outside a game context (ie, where a list of teams has been constructed),
// this will just be the side's default color.
if(c.blank() || c.empty()) {
return get_side_color_id(cfg["side"].to_unsigned(1));
return get_side_color_id(cfg["side"].to_unsigned());
}

// Do the same as above for numeric color key values.
if(unsigned side = c.to_unsigned(1)) {
if(unsigned side = c.to_unsigned()) {
return get_side_color_id(side);
}

Expand Down

0 comments on commit 370763e

Please sign in to comment.