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

actorid
Marc Zinnschlag 15 years ago
parent db2b238328
commit 814d721e33

@ -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;
}

@ -226,12 +226,14 @@ namespace ESMS
const Cell *searchExtByRegion (const std::string& id) const
{
std::string id2 = toLower (id);
for (ExtCells::const_iterator iter = extCells.begin(); iter!=extCells.end(); ++iter)
{
const ExtCellsCol& column = iter->second;
for (ExtCellsCol::const_iterator iter = column.begin(); iter!=column.end(); ++iter)
{
if (iter->second->region==id)
if (toLower (iter->second->region)==id)
return iter->second;
}
}

Loading…
Cancel
Save