[Client] Make it possible to easily iterate through container items

pull/163/head
David Cernat 8 years ago
parent c8cbfbef62
commit 88f891b5bd

@ -47,6 +47,20 @@ void WorldEvent::addContainerItem(ContainerItem containerItem)
void WorldEvent::sendContainers(MWWorld::CellStore* cellStore) 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; 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 float CellStore::getWaterLevel() const
{ {
if (isExterior()) if (isExterior())

@ -243,6 +243,9 @@ namespace MWWorld
void setLastRefNumIndex(unsigned int value); void setLastRefNumIndex(unsigned int value);
// Added by tes3mp and used to record the last reference number in the cell // 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; float getWaterLevel() const;
void setWaterLevel (float level); void setWaterLevel (float level);

Loading…
Cancel
Save