From c01153569d25f5f408d2b32202e2707adc8d1d2d Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Sat, 4 May 2019 12:36:58 +0400 Subject: [PATCH 1/3] Add missing Organic flag check for herbalism --- apps/openmw/mwrender/animation.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/apps/openmw/mwrender/animation.cpp b/apps/openmw/mwrender/animation.cpp index 8537060f6..2de39aee4 100644 --- a/apps/openmw/mwrender/animation.cpp +++ b/apps/openmw/mwrender/animation.cpp @@ -1990,9 +1990,7 @@ namespace MWRender mObjectRoot->accept(visitor); } - if (ptr.getTypeName() == typeid(ESM::Container).name() && - SceneUtil::hasUserDescription(mObjectRoot, Constants::HerbalismLabel) && - ptr.getRefData().getCustomData() != nullptr) + if (ptr.getRefData().getCustomData() != nullptr && canBeHarvested()) { const MWWorld::ContainerStore& store = ptr.getClass().getContainerStore(ptr); if (!store.hasVisibleItems()) From 29cfd2c583a5dc0a607de5c15c68a8252af17b94 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Sat, 4 May 2019 14:09:09 +0400 Subject: [PATCH 2/3] Do not respawn container if player did not touch it --- apps/openmw/mwclass/container.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/openmw/mwclass/container.cpp b/apps/openmw/mwclass/container.cpp index 55d2689f8..1a5cd354d 100644 --- a/apps/openmw/mwclass/container.cpp +++ b/apps/openmw/mwclass/container.cpp @@ -89,6 +89,10 @@ namespace MWClass ptr.get(); if (ref->mBase->mFlags & ESM::Container::Respawn) { + // Container was not touched, there is no need to modify its content. + if (ptr.getRefData().getCustomData() == nullptr) + return; + MWBase::Environment::get().getWorld()->removeContainerScripts(ptr); ptr.getRefData().setCustomData(nullptr); } From c91d1e73942492950bd98639e4530faf7da36c1b Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Sat, 4 May 2019 14:09:52 +0400 Subject: [PATCH 3/3] Ignore containers without resolved content for Detect spells --- apps/openmw/mwworld/worldimp.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 1aac737c3..cd03137d7 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -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)