mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-20 07:53:51 +00:00
move getExterior back
This commit is contained in:
parent
3f007d29cc
commit
8d4dc096a4
3 changed files with 24 additions and 32 deletions
|
@ -206,30 +206,6 @@ namespace MWWorld
|
|||
|
||||
changeCell (x, y, position, true);
|
||||
}
|
||||
|
||||
const ESM::Cell *Scene::getExterior (const std::string& cellName) const
|
||||
{
|
||||
// first try named cells
|
||||
if (const ESM::Cell *cell = mWorld->getStore().cells.searchExtByName (cellName))
|
||||
return cell;
|
||||
|
||||
// didn't work -> now check for regions
|
||||
std::string cellName2 = ESMS::RecListT<ESM::Region>::toLower (cellName);
|
||||
|
||||
for (ESMS::RecListT<ESM::Region>::MapType::const_iterator iter (mWorld->getStore().regions.list.begin());
|
||||
iter!=mWorld->getStore().regions.list.end(); ++iter)
|
||||
{
|
||||
if (ESMS::RecListT<ESM::Region>::toLower (iter->second.name)==cellName2)
|
||||
{
|
||||
if (const ESM::Cell *cell = mWorld->getStore().cells.searchExtByRegion (iter->first))
|
||||
return cell;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Ptr::CellStore* Scene::getCurrentCell ()
|
||||
{
|
||||
|
|
|
@ -93,9 +93,6 @@ namespace MWWorld
|
|||
void changeToExteriorCell (const ESM::Position& position);
|
||||
///< Move to exterior cell.
|
||||
|
||||
const ESM::Cell *getExterior (const std::string& cellName) const;
|
||||
///< Return a cell matching the given name or a 0-pointer, if there is no such cell.
|
||||
|
||||
void markCellAsUnchanged();
|
||||
|
||||
std::string getFacedHandle();
|
||||
|
|
|
@ -320,6 +320,30 @@ namespace MWWorld
|
|||
delete mGlobalVariables;
|
||||
delete mWorldScene;
|
||||
}
|
||||
|
||||
const ESM::Cell *World::getExterior (const std::string& cellName) const
|
||||
{
|
||||
// first try named cells
|
||||
if (const ESM::Cell *cell = mStore.cells.searchExtByName (cellName))
|
||||
return cell;
|
||||
|
||||
// didn't work -> now check for regions
|
||||
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;
|
||||
}
|
||||
|
||||
Ptr::CellStore *World::getExterior (int x, int y)
|
||||
{
|
||||
|
@ -581,11 +605,6 @@ namespace MWWorld
|
|||
return mWorldScene->changeToExteriorCell(position);
|
||||
}
|
||||
|
||||
const ESM::Cell *World::getExterior (const std::string& cellName) const
|
||||
{
|
||||
return mWorldScene->getExterior(cellName);
|
||||
}
|
||||
|
||||
void World::markCellAsUnchanged()
|
||||
{
|
||||
return mWorldScene->markCellAsUnchanged();
|
||||
|
|
Loading…
Reference in a new issue