1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-31 19:45:34 +00:00

Merge branch 'thrust_into_the_light' into 'master'

Detect keys and enchanted items in containers without custom data

Closes #6326

See merge request OpenMW/openmw!1265
This commit is contained in:
psi29a 2021-10-11 09:13:31 +00:00
commit 66a6b80df9
2 changed files with 23 additions and 0 deletions

View file

@ -52,6 +52,7 @@
Bug #6302: Teleporting disabled actor breaks its disabled state
Bug #6307: Pathfinding in Infidelities quest from Tribunal addon is broken
Bug #6323: Wyrmhaven: Alboin doesn't follower the player character out of his house
Bug #6326: Detect Enchantment/Key should detect items in unresolved containers
Feature #890: OpenMW-CS: Column filtering
Feature #2554: Modifying an object triggers the instances table to scroll to the corresponding record
Feature #2780: A way to see current OpenMW version in the console

View file

@ -3420,7 +3420,29 @@ namespace MWWorld
{
// but ignore containers without resolved content
if (isContainer && ptr.getRefData().getCustomData() == nullptr)
{
const auto& store = MWBase::Environment::get().getWorld()->getStore();
for(const auto& containerItem : ptr.get<ESM::Container>()->mBase->mInventory.mList)
{
if(containerItem.mCount)
{
try
{
ManualRef ref(store, containerItem.mItem, containerItem.mCount);
if(needToAdd(ref.getPtr(), mDetector))
{
mOut.push_back(ptr);
return true;
}
}
catch (const std::exception&)
{
// Ignore invalid item id
}
}
}
return true;
}
MWWorld::ContainerStore& store = ptr.getClass().getContainerStore(ptr);
{