mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 21:49:55 +00:00
[Client] Include NPC/creature containers when adding all cell containers
This commit is contained in:
parent
1e3c4fd488
commit
26a56d6a02
1 changed files with 13 additions and 14 deletions
|
@ -717,23 +717,22 @@ void WorldEvent::playVideo()
|
||||||
|
|
||||||
void WorldEvent::addAllContainers(MWWorld::CellStore* cellStore)
|
void WorldEvent::addAllContainers(MWWorld::CellStore* cellStore)
|
||||||
{
|
{
|
||||||
MWWorld::CellRefList<ESM::Container> *containerList = cellStore->getContainers();
|
for (auto &ref : cellStore->getContainers()->mList)
|
||||||
|
|
||||||
for (auto &container : containerList->mList)
|
|
||||||
{
|
{
|
||||||
mwmp::WorldObject worldObject;
|
MWWorld::Ptr ptr(&ref, 0);
|
||||||
worldObject.refId = container.mRef.getRefId();
|
addEntireContainer(ptr);
|
||||||
worldObject.refNumIndex = container.mRef.getRefNum().mIndex;
|
}
|
||||||
worldObject.mpNum = container.mRef.getMpNum();
|
|
||||||
|
|
||||||
MWWorld::ContainerStore& containerStore = container.mClass->getContainerStore(MWWorld::Ptr(&container, 0));
|
for (auto &ref : cellStore->getNpcs()->mList)
|
||||||
|
{
|
||||||
|
MWWorld::Ptr ptr(&ref, 0);
|
||||||
|
addEntireContainer(ptr);
|
||||||
|
}
|
||||||
|
|
||||||
for (const auto itemPtr : containerStore)
|
for (auto &ref : cellStore->getCreatures()->mList)
|
||||||
{
|
{
|
||||||
addContainerItem(worldObject, itemPtr, 0);
|
MWWorld::Ptr ptr(&ref, 0);
|
||||||
}
|
addEntireContainer(ptr);
|
||||||
|
|
||||||
addObject(worldObject);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue