Restore forcegreet with disabled actors

This commit is contained in:
kuyondo 2025-07-22 08:37:13 +08:00
parent c30964feb2
commit f3d23dc57e
4 changed files with 19 additions and 3 deletions

View File

@ -165,7 +165,7 @@ namespace MWScript
{ {
MWWorld::Ptr ptr = R()(runtime); MWWorld::Ptr ptr = R()(runtime);
if (!ptr.getRefData().isEnabled()) if (!ptr.getRefData().isEnabled() && !ptr.getRefData().isResolved())
return; return;
if (!ptr.getClass().isActor()) if (!ptr.getClass().isActor())

View File

@ -19,7 +19,8 @@ namespace
Flag_SuppressActivate = 1, // If set, activation will be suppressed and redirected to the OnActivate flag, which Flag_SuppressActivate = 1, // If set, activation will be suppressed and redirected to the OnActivate flag, which
// can then be handled by a script. // can then be handled by a script.
Flag_OnActivate = 2, Flag_OnActivate = 2,
Flag_ActivationBuffered = 4 Flag_ActivationBuffered = 4,
Flag_Resolved = 8,
}; };
} }
@ -312,4 +313,14 @@ namespace MWWorld
return mAnimationState; return mAnimationState;
} }
void RefData::flagAsResolved()
{
mFlags |= Flag_Resolved;
}
bool RefData::isResolved() const
{
return mFlags & Flag_Resolved;
}
} }

View File

@ -146,6 +146,9 @@ namespace MWWorld
const ESM::AnimationState& getAnimationState() const; const ESM::AnimationState& getAnimationState() const;
ESM::AnimationState& getAnimationState(); ESM::AnimationState& getAnimationState();
void flagAsResolved();
bool isResolved() const;
}; };
} }

View File

@ -138,6 +138,8 @@ namespace
if (!model.empty()) if (!model.empty())
ptr.getClass().insertObject(ptr, model, rotation, physics); ptr.getClass().insertObject(ptr, model, rotation, physics);
ptr.getRefData().flagAsResolved();
MWBase::Environment::get().getLuaManager()->objectAddedToScene(ptr); MWBase::Environment::get().getLuaManager()->objectAddedToScene(ptr);
} }
@ -1132,7 +1134,7 @@ namespace MWWorld
{ {
const VFS::Path::Normalized meshPath = useAnim const VFS::Path::Normalized meshPath = useAnim
? Misc::ResourceHelpers::correctActorModelPath( ? Misc::ResourceHelpers::correctActorModelPath(
VFS::Path::toNormalized(mesh), mRendering.getResourceSystem()->getVFS()) VFS::Path::toNormalized(mesh), mRendering.getResourceSystem()->getVFS())
: VFS::Path::toNormalized(mesh); : VFS::Path::toNormalized(mesh);
if (mRendering.getResourceSystem()->getSceneManager()->checkLoaded(meshPath, mRendering.getReferenceTime())) if (mRendering.getResourceSystem()->getSceneManager()->checkLoaded(meshPath, mRendering.getReferenceTime()))