Skip to content

Commit

Permalink
Revert "Fix team_info::side_name() returning wrong type"
Browse files Browse the repository at this point in the history
This reverts commit 89ef1d3.

That commit made side_name() return a wrong value in case
current_player changed during a game.
  • Loading branch information
gfgtdf committed Mar 9, 2016
1 parent 49ee9da commit d424911
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions src/team.cpp
Expand Up @@ -127,9 +127,6 @@ void team::team_info::read(const config &cfg)
side_name = cfg["side_name"];
save_id = cfg["save_id"].str();
current_player = cfg["current_player"].str();
if(side_name.empty()) {
side_name = current_player;
}
countdown_time = cfg["countdown_time"].str();
action_bonus_count = cfg["action_bonus_count"];
flag = cfg["flag"].str();
Expand Down
2 changes: 1 addition & 1 deletion src/team.hpp
Expand Up @@ -303,7 +303,7 @@ class team : public savegame::savegame_config
void set_flag(const std::string& flag) { info_.flag = flag; }
void set_flag_icon(const std::string& flag_icon) { info_.flag_icon = flag_icon; }

const t_string& side_name() const { return info_.side_name; }
const std::string& side_name() const { return info_.side_name.empty() ? info_.current_player : info_.side_name.str(); }
//Returns true if the hex is shrouded/fogged for this side, or
//any other ally with shared vision.
bool shrouded(const map_location& loc) const;
Expand Down

0 comments on commit d424911

Please sign in to comment.