Skip to content

Commit d3b4ea0

Browse files
committed
Only mark valid actor ids for conversion
1 parent 72de0c0 commit d3b4ea0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apps/openmw/mwworld/cellstore.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,9 @@ namespace
257257
if constexpr (std::is_same_v<T, ESM::Creature> || std::is_same_v<T, ESM::NPC>)
258258
MWWorld::convertEnchantmentSlots(state.mCreatureStats, state.mInventory);
259259
}
260-
if (reader.getActorIdConverter())
260+
if constexpr (std::is_same_v<T, ESM::Creature> || std::is_same_v<T, ESM::NPC>)
261261
{
262-
if constexpr (std::is_same_v<T, ESM::Creature> || std::is_same_v<T, ESM::NPC>)
262+
if (reader.getActorIdConverter() && state.mHasCustomState)
263263
{
264264
MWBase::Environment::get().getWorldModel()->assignSaveFileRefNum(state.mRef);
265265
reader.getActorIdConverter()->mMappings.emplace(state.mCreatureStats.mActorId, state.mRef.mRefNum);

0 commit comments

Comments
 (0)