Fix a Visual Studio compiler warning

Two variables called "name" were in scope simultaneously and one
shadowed the other.
This commit is contained in:
Jyrki Vesterinen 2019-04-18 21:48:35 +03:00
parent d64dafc500
commit 671f32aa62

View file

@ -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"],