forked from teamnwah/openmw-tes3coop
build external cell names from name of region instead of from internal region id
This commit is contained in:
parent
db2b238328
commit
814d721e33
2 changed files with 16 additions and 4 deletions
|
@ -698,9 +698,19 @@ namespace MWWorld
|
||||||
return cell;
|
return cell;
|
||||||
|
|
||||||
// didn't work -> now check for regions
|
// didn't work -> now check for regions
|
||||||
if (mStore.regions.search (cellName))
|
std::string cellName2 = ESMS::RecListT<ESM::Region>::toLower (cellName);
|
||||||
if (const ESM::Cell *cell = mStore.cells.searchExtByRegion (cellName))
|
|
||||||
return cell;
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -226,12 +226,14 @@ namespace ESMS
|
||||||
|
|
||||||
const Cell *searchExtByRegion (const std::string& id) const
|
const Cell *searchExtByRegion (const std::string& id) const
|
||||||
{
|
{
|
||||||
|
std::string id2 = toLower (id);
|
||||||
|
|
||||||
for (ExtCells::const_iterator iter = extCells.begin(); iter!=extCells.end(); ++iter)
|
for (ExtCells::const_iterator iter = extCells.begin(); iter!=extCells.end(); ++iter)
|
||||||
{
|
{
|
||||||
const ExtCellsCol& column = iter->second;
|
const ExtCellsCol& column = iter->second;
|
||||||
for (ExtCellsCol::const_iterator iter = column.begin(); iter!=column.end(); ++iter)
|
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;
|
return iter->second;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue