mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-03 17:37:18 +00:00
Detect keys and enchanted items in containers without custom data
This commit is contained in:
parent
7af245d205
commit
f6eeee3ad5
@ -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
|
||||
|
@ -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);
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user