From 671f32aa62e5c5eedfc438fb7a6d17dd11f1cb94 Mon Sep 17 00:00:00 2001 From: Jyrki Vesterinen Date: Thu, 18 Apr 2019 21:48:35 +0300 Subject: [PATCH] Fix a Visual Studio compiler warning Two variables called "name" were in scope simultaneously and one shadowed the other. --- src/units/abilities.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/units/abilities.cpp b/src/units/abilities.cpp index ad65896d1f4..049c23f8575 100644 --- a/src/units/abilities.cpp +++ b/src/units/abilities.cpp @@ -274,10 +274,9 @@ namespace { */ bool add_ability_tooltip(const config::any_child &ab, unit_race::GENDER gender, std::vector>& 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"],