mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-26 14:36:40 -04:00
[Client] Make it possible to easily iterate through container items
This commit is contained in:
parent
c8cbfbef62
commit
88f891b5bd
@ -47,6 +47,20 @@ void WorldEvent::addContainerItem(ContainerItem containerItem)
|
||||
|
||||
void WorldEvent::sendContainers(MWWorld::CellStore* cellStore)
|
||||
{
|
||||
MWWorld::CellRefList<ESM::Container> *containerList = cellStore->getContainers();
|
||||
|
||||
for (typename MWWorld::CellRefList<ESM::Container>::List::iterator listIter(containerList->mList.begin());
|
||||
listIter != containerList->mList.end(); ++listIter)
|
||||
{
|
||||
MWWorld::Ptr container(&*listIter, 0);
|
||||
|
||||
MWWorld::ContainerStore& containerStore = container.getClass().getContainerStore(container);
|
||||
|
||||
for (MWWorld::ContainerStoreIterator storeIter = containerStore.begin(); storeIter != containerStore.end(); ++storeIter)
|
||||
{
|
||||
MWWorld::Ptr itemPtr = *storeIter;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -491,6 +491,12 @@ namespace MWWorld
|
||||
lastRefNumIndex = value;
|
||||
}
|
||||
|
||||
// Added by tes3mp and used to get all the containers in the cell
|
||||
CellRefList<ESM::Container> *CellStore::getContainers()
|
||||
{
|
||||
return &mContainers;
|
||||
}
|
||||
|
||||
float CellStore::getWaterLevel() const
|
||||
{
|
||||
if (isExterior())
|
||||
|
@ -243,6 +243,9 @@ namespace MWWorld
|
||||
void setLastRefNumIndex(unsigned int value);
|
||||
// Added by tes3mp and used to record the last reference number in the cell
|
||||
|
||||
CellRefList<ESM::Container> *getContainers();
|
||||
// Added by tes3mp and used to get all the containers in the cell
|
||||
|
||||
float getWaterLevel() const;
|
||||
|
||||
void setWaterLevel (float level);
|
||||
|
Loading…
x
Reference in New Issue
Block a user