1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-17 20:58:07 +02:00

map editor: fix reading town faction name for non random towns on h3m maps

This commit is contained in:
godric3 2024-10-06 13:59:34 +02:00
parent d3db673df2
commit 87ebb22a55

View File

@ -376,7 +376,7 @@ void CGTownInstance::onHeroLeave(const CGHeroInstance * h) const
std::string CGTownInstance::getObjectName() const
{
return getNameTranslated() + ", " + (ID == Obj::RANDOM_TOWN ? "Random town" : town->faction->getNameTranslated());
return getNameTranslated() + ", " + (ID == Obj::RANDOM_TOWN ? "Random town" : getFaction().toEntity(VLC)->getNameTranslated());
}
bool CGTownInstance::townEnvisagesBuilding(BuildingSubID::EBuildingSubID subId) const