Skip to content

Commit

Permalink
Fix a Visual Studio compiler warning
Browse files Browse the repository at this point in the history
Two variables called "name" were in scope simultaneously and one
shadowed the other.
  • Loading branch information
jyrkive committed Apr 18, 2019
1 parent d64dafc commit 671f32a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/units/abilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,9 @@ namespace {
*/
bool add_ability_tooltip(const config::any_child &ab, unit_race::GENDER gender, std::vector<std::tuple<std::string, t_string,t_string,t_string>>& res, bool active)
{
const t_string& name =
gender_value(ab.cfg, gender, "name", "female_name", "name").t_str();

if (active) {
const t_string& name = gender_value(ab.cfg, gender, "name", "female_name", "name").t_str();

if (!name.empty()) {
res.emplace_back(
ab.cfg["id"],
Expand Down

0 comments on commit 671f32a

Please sign in to comment.