Merge branch 'logiut_kopio' into 'master'

Restore forcegreet with disabled actors

See merge request OpenMW/openmw!4705
This commit is contained in:
Kuyondo 2025-08-02 08:41:39 +00:00
commit 261a8ee91f
6 changed files with 25 additions and 4 deletions

View File

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

View File

@ -298,6 +298,11 @@ namespace
iter->mData.enable();
MWBase::Environment::get().getWorld()->disable(ptr);
}
else
{
if (state.mVersion < ESM::OpenMW0_50SaveGameFormatVersion)
iter->mData.flagAsResolved();
}
MWBase::Environment::get().getWorldModel()->registerPtr(ptr);
return;
}

View File

@ -19,7 +19,8 @@ namespace
Flag_SuppressActivate = 1, // If set, activation will be suppressed and redirected to the OnActivate flag, which
// can then be handled by a script.
Flag_OnActivate = 2,
Flag_ActivationBuffered = 4
Flag_ActivationBuffered = 4,
Flag_Resolved = 8
};
}
@ -133,7 +134,7 @@ namespace MWWorld
try
{
copy(refData);
mFlags &= ~(Flag_SuppressActivate | Flag_OnActivate | Flag_ActivationBuffered);
mFlags &= ~(Flag_SuppressActivate | Flag_OnActivate | Flag_ActivationBuffered | Flag_Resolved);
}
catch (...)
{
@ -312,4 +313,14 @@ namespace MWWorld
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;
ESM::AnimationState& getAnimationState();
void flagAsResolved();
bool isResolved() const;
};
}

View File

@ -138,6 +138,8 @@ namespace
if (!model.empty())
ptr.getClass().insertObject(ptr, model, rotation, physics);
ptr.getRefData().flagAsResolved();
MWBase::Environment::get().getLuaManager()->objectAddedToScene(ptr);
}

View File

@ -28,7 +28,7 @@ namespace ESM
inline constexpr FormatVersion MaxOldCountFormatVersion = 30;
inline constexpr FormatVersion MaxActiveSpellTypeVersion = 31;
inline constexpr FormatVersion MaxPlayerBeforeCellDataFormatVersion = 32;
inline constexpr FormatVersion CurrentSaveGameFormatVersion = 34;
inline constexpr FormatVersion CurrentSaveGameFormatVersion = 35;
inline constexpr FormatVersion MinSupportedSaveGameFormatVersion = 5;
inline constexpr FormatVersion OpenMW0_48SaveGameFormatVersion = 21;