build external cell names from name of region instead of from internal region id

This commit is contained in:
Marc Zinnschlag 2010-09-11 15:12:42 +02:00
parent db2b238328
commit 814d721e33
2 changed files with 16 additions and 4 deletions

View file

@ -698,9 +698,19 @@ namespace MWWorld
return cell;
// didn't work -> now check for regions
if (mStore.regions.search (cellName))
if (const ESM::Cell *cell = mStore.cells.searchExtByRegion (cellName))
return cell;
std::string cellName2 = ESMS::RecListT<ESM::Region>::toLower (cellName);
for (ESMS::RecListT<ESM::Region>::MapType::const_iterator iter (mStore.regions.list.begin());
iter!=mStore.regions.list.end(); ++iter)
{
if (ESMS::RecListT<ESM::Region>::toLower (iter->second.name)==cellName2)
{
if (const ESM::Cell *cell = mStore.cells.searchExtByRegion (iter->first))
return cell;
break;
}
}
return 0;
}