1
0
Fork 1
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:
Sebastian Wick 2011-08-01 14:41:15 +02:00
parent 3f007d29cc
commit 8d4dc096a4
3 changed files with 24 additions and 32 deletions

View file

@ -207,30 +207,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 ()
{
return mCurrentCell;

View file

@ -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();

View file

@ -321,6 +321,30 @@ namespace MWWorld
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)
{
return &mExteriors[std::make_pair (x, 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();