mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-29 17:06:43 +00:00
Fixed issue which may occur if there's no evidence chest nearby
This commit is contained in:
parent
f6deca7c80
commit
ee581f593b
1 changed files with 5 additions and 4 deletions
|
@ -2695,6 +2695,7 @@ namespace MWWorld
|
||||||
MWWorld::Ptr closestChest;
|
MWWorld::Ptr closestChest;
|
||||||
float closestDistance = FLT_MAX;
|
float closestDistance = FLT_MAX;
|
||||||
|
|
||||||
|
//Find closest stolen_goods chest
|
||||||
std::vector<MWWorld::Ptr> chests;
|
std::vector<MWWorld::Ptr> chests;
|
||||||
mCells.getInteriorPtrs("stolen_goods", chests);
|
mCells.getInteriorPtrs("stolen_goods", chests);
|
||||||
|
|
||||||
|
@ -2712,20 +2713,20 @@ namespace MWWorld
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!closestChest.isEmpty())
|
if (!closestChest.isEmpty()) //Found a close chest
|
||||||
{
|
{
|
||||||
ContainerStore& store = ptr.getClass().getContainerStore(ptr);
|
ContainerStore& store = ptr.getClass().getContainerStore(ptr);
|
||||||
for (ContainerStoreIterator it = store.begin(); it != store.end(); ++it)
|
for (ContainerStoreIterator it = store.begin(); it != store.end(); ++it) //Move all stolen stuff into chest
|
||||||
{
|
{
|
||||||
if (!it->getCellRef().mOwner.empty() && it->getCellRef().mOwner != "player")
|
if (!it->getCellRef().mOwner.empty() && it->getCellRef().mOwner != "player") //Not owned by no one/player?
|
||||||
{
|
{
|
||||||
closestChest.getClass().getContainerStore(closestChest).add(*it, it->getRefData().getCount(), closestChest);
|
closestChest.getClass().getContainerStore(closestChest).add(*it, it->getRefData().getCount(), closestChest);
|
||||||
store.remove(*it, it->getRefData().getCount(), ptr);
|
store.remove(*it, it->getRefData().getCount(), ptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
closestChest.getCellRef().mLockLevel = abs(closestChest.getCellRef().mLockLevel);
|
closestChest.getCellRef().mLockLevel = abs(closestChest.getCellRef().mLockLevel);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void World::goToJail()
|
void World::goToJail()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue