mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 08:23:53 +00:00
Ignore containers without resolved content for Detect spells
This commit is contained in:
parent
29cfd2c583
commit
c91d1e7394
1 changed files with 6 additions and 2 deletions
|
@ -3335,9 +3335,13 @@ namespace MWWorld
|
|||
return true;
|
||||
|
||||
// Consider references inside containers as well (except if we are looking for a Creature, they cannot be in containers)
|
||||
if (mType != World::Detect_Creature &&
|
||||
(ptr.getClass().isActor() || ptr.getClass().getTypeName() == typeid(ESM::Container).name()))
|
||||
bool isContainer = ptr.getClass().getTypeName() == typeid(ESM::Container).name();
|
||||
if (mType != World::Detect_Creature && (ptr.getClass().isActor() || isContainer))
|
||||
{
|
||||
// but ignore containers without resolved content
|
||||
if (isContainer && ptr.getRefData().getCustomData() == nullptr)
|
||||
return true;
|
||||
|
||||
MWWorld::ContainerStore& store = ptr.getClass().getContainerStore(ptr);
|
||||
{
|
||||
for (MWWorld::ContainerStoreIterator it = store.begin(); it != store.end(); ++it)
|
||||
|
|
Loading…
Reference in a new issue