mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-24 08:32:34 +02:00
Little refactoring
This commit is contained in:
parent
94c6adb28c
commit
082e1194ff
@ -87,11 +87,10 @@ std::string AbstractSettings::getTownName(const CMap & map, int objectIdx)
|
||||
std::string name;
|
||||
if(auto town = dynamic_cast<const CGTownInstance*>(map.objects[objectIdx].get()))
|
||||
{
|
||||
auto * ctown = town->town;
|
||||
if(!ctown)
|
||||
ctown = VLC->townh->randomTown;
|
||||
|
||||
name = ctown->faction ? town->getObjectName() : town->getNameTranslated() + ", (random)";
|
||||
name = town->getNameTranslated();
|
||||
|
||||
if(name.empty())
|
||||
name = town->getTown()->faction->getNameTranslated();
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user