|
|
|
@ -294,7 +294,7 @@ MWWorld::CellStore* MWWorld::WorldModel::getCellByPosition(
|
|
|
|
|
return getInterior(cellNameInSameWorldSpace);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MWWorld::Ptr MWWorld::WorldModel::getPtr(const ESM::RefId& name, CellStore& cell, bool searchInContainers)
|
|
|
|
|
MWWorld::Ptr MWWorld::WorldModel::getPtr(const ESM::RefId& name, CellStore& cell)
|
|
|
|
|
{
|
|
|
|
|
if (cell.getState() == CellStore::State_Unloaded)
|
|
|
|
|
cell.preload();
|
|
|
|
@ -314,9 +314,6 @@ MWWorld::Ptr MWWorld::WorldModel::getPtr(const ESM::RefId& name, CellStore& cell
|
|
|
|
|
if (!ptr.isEmpty() && MWWorld::CellStore::isAccessible(ptr.getRefData(), ptr.getCellRef()))
|
|
|
|
|
return ptr;
|
|
|
|
|
|
|
|
|
|
if (searchInContainers)
|
|
|
|
|
return cell.searchInContainer(name);
|
|
|
|
|
|
|
|
|
|
return Ptr();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -377,37 +374,6 @@ MWWorld::Ptr MWWorld::WorldModel::getPtr(const ESM::RefId& name)
|
|
|
|
|
return Ptr();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MWWorld::Ptr MWWorld::WorldModel::getPtr(const ESM::RefId& id, const ESM::RefNum& refNum)
|
|
|
|
|
{
|
|
|
|
|
for (auto& pair : mInteriors)
|
|
|
|
|
{
|
|
|
|
|
Ptr ptr = getPtr(pair.second, id, refNum);
|
|
|
|
|
if (!ptr.isEmpty())
|
|
|
|
|
return ptr;
|
|
|
|
|
}
|
|
|
|
|
for (auto& pair : mExteriors)
|
|
|
|
|
{
|
|
|
|
|
Ptr ptr = getPtr(pair.second, id, refNum);
|
|
|
|
|
if (!ptr.isEmpty())
|
|
|
|
|
return ptr;
|
|
|
|
|
}
|
|
|
|
|
return Ptr();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MWWorld::Ptr MWWorld::WorldModel::getPtr(CellStore& cellStore, const ESM::RefId& id, const ESM::RefNum& refNum)
|
|
|
|
|
{
|
|
|
|
|
if (cellStore.getState() == CellStore::State_Unloaded)
|
|
|
|
|
cellStore.preload();
|
|
|
|
|
if (cellStore.getState() == CellStore::State_Preloaded)
|
|
|
|
|
{
|
|
|
|
|
if (cellStore.hasId(id))
|
|
|
|
|
cellStore.load();
|
|
|
|
|
else
|
|
|
|
|
return Ptr();
|
|
|
|
|
}
|
|
|
|
|
return cellStore.searchViaRefNum(refNum);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MWWorld::WorldModel::getExteriorPtrs(const ESM::RefId& name, std::vector<MWWorld::Ptr>& out)
|
|
|
|
|
{
|
|
|
|
|
const MWWorld::Store<ESM::Cell>& cells = mStore.get<ESM::Cell>();
|
|
|
|
@ -422,20 +388,6 @@ void MWWorld::WorldModel::getExteriorPtrs(const ESM::RefId& name, std::vector<MW
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MWWorld::WorldModel::getInteriorPtrs(const ESM::RefId& name, std::vector<MWWorld::Ptr>& out)
|
|
|
|
|
{
|
|
|
|
|
const MWWorld::Store<ESM::Cell>& cells = mStore.get<ESM::Cell>();
|
|
|
|
|
for (MWWorld::Store<ESM::Cell>::iterator iter = cells.intBegin(); iter != cells.intEnd(); ++iter)
|
|
|
|
|
{
|
|
|
|
|
CellStore* cellStore = getCellStore(&(*iter));
|
|
|
|
|
|
|
|
|
|
Ptr ptr = getPtrAndCache(name, *cellStore);
|
|
|
|
|
|
|
|
|
|
if (!ptr.isEmpty())
|
|
|
|
|
out.push_back(ptr);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::vector<MWWorld::Ptr> MWWorld::WorldModel::getAll(const ESM::RefId& id)
|
|
|
|
|
{
|
|
|
|
|
PtrCollector visitor;
|
|
|
|
|