mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-14 15:40:18 +00:00
move getExterior back
This commit is contained in:
parent
3f007d29cc
commit
8d4dc096a4
@ -207,30 +207,6 @@ namespace MWWorld
|
|||||||
changeCell (x, y, position, true);
|
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 ()
|
Ptr::CellStore* Scene::getCurrentCell ()
|
||||||
{
|
{
|
||||||
return mCurrentCell;
|
return mCurrentCell;
|
||||||
|
@ -93,9 +93,6 @@ namespace MWWorld
|
|||||||
void changeToExteriorCell (const ESM::Position& position);
|
void changeToExteriorCell (const ESM::Position& position);
|
||||||
///< Move to exterior cell.
|
///< 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();
|
void markCellAsUnchanged();
|
||||||
|
|
||||||
std::string getFacedHandle();
|
std::string getFacedHandle();
|
||||||
|
@ -321,6 +321,30 @@ namespace MWWorld
|
|||||||
delete mWorldScene;
|
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)
|
Ptr::CellStore *World::getExterior (int x, int y)
|
||||||
{
|
{
|
||||||
return &mExteriors[std::make_pair (x, y)];
|
return &mExteriors[std::make_pair (x, y)];
|
||||||
@ -581,11 +605,6 @@ namespace MWWorld
|
|||||||
return mWorldScene->changeToExteriorCell(position);
|
return mWorldScene->changeToExteriorCell(position);
|
||||||
}
|
}
|
||||||
|
|
||||||
const ESM::Cell *World::getExterior (const std::string& cellName) const
|
|
||||||
{
|
|
||||||
return mWorldScene->getExterior(cellName);
|
|
||||||
}
|
|
||||||
|
|
||||||
void World::markCellAsUnchanged()
|
void World::markCellAsUnchanged()
|
||||||
{
|
{
|
||||||
return mWorldScene->markCellAsUnchanged();
|
return mWorldScene->markCellAsUnchanged();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user