|
|
|
@ -578,28 +578,37 @@ namespace MWWorld
|
|
|
|
|
|
|
|
|
|
std::string lowerCaseName = Misc::StringUtils::lowerCase(name);
|
|
|
|
|
|
|
|
|
|
// active cells
|
|
|
|
|
for (Scene::CellStoreCollection::const_iterator iter (mWorldScene->getActiveCells().begin());
|
|
|
|
|
iter!=mWorldScene->getActiveCells().end(); ++iter)
|
|
|
|
|
{
|
|
|
|
|
// TODO: caching still doesn't work efficiently here (only works for the one CellStore that the reference is in)
|
|
|
|
|
CellStore* cellstore = *iter;
|
|
|
|
|
Ptr ptr = mCells.getPtr (lowerCaseName, *cellstore, true);
|
|
|
|
|
Ptr ptr = mCells.getPtr (lowerCaseName, *cellstore, false);
|
|
|
|
|
|
|
|
|
|
if (!ptr.isEmpty())
|
|
|
|
|
return ptr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Ptr ptr = mPlayer->getPlayer().getClass()
|
|
|
|
|
.getContainerStore(mPlayer->getPlayer()).search(lowerCaseName);
|
|
|
|
|
|
|
|
|
|
if (!ptr.isEmpty())
|
|
|
|
|
return ptr;
|
|
|
|
|
|
|
|
|
|
if (!activeOnly)
|
|
|
|
|
{
|
|
|
|
|
ret = mCells.getPtr (lowerCaseName);
|
|
|
|
|
if (!ret.isEmpty())
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
|
|
for (Scene::CellStoreCollection::const_iterator iter (mWorldScene->getActiveCells().begin());
|
|
|
|
|
iter!=mWorldScene->getActiveCells().end(); ++iter)
|
|
|
|
|
{
|
|
|
|
|
CellStore* cellstore = *iter;
|
|
|
|
|
Ptr ptr = cellstore->searchInContainer(lowerCaseName);
|
|
|
|
|
if (!ptr.isEmpty())
|
|
|
|
|
return ptr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Ptr ptr = mPlayer->getPlayer().getClass()
|
|
|
|
|
.getContainerStore(mPlayer->getPlayer()).search(lowerCaseName);
|
|
|
|
|
|
|
|
|
|
return ptr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Ptr World::getPtr (const std::string& name, bool activeOnly)
|
|
|
|
|