mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-04 03:40:14 +00:00
Merge pull request #2363 from akortunov/herbalism
Additional herbalism-related tweaks
This commit is contained in:
commit
a737935748
@ -89,6 +89,10 @@ namespace MWClass
|
||||
ptr.get<ESM::Container>();
|
||||
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);
|
||||
}
|
||||
|
@ -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())
|
||||
|
@ -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…
x
Reference in New Issue
Block a user