From 7cecf2844aa9f434012d198c08b3c1ca32a8cb0f Mon Sep 17 00:00:00 2001 From: Petr Mikheev Date: Mon, 5 Jun 2023 22:19:24 +0200 Subject: [PATCH] Fix #7411 --- apps/openmw/mwworld/worldimp.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 080bc324dc..7e99ee96ae 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -502,6 +502,12 @@ namespace MWWorld } break; case ESM::REC_PLAY: + // World::write always puts `ESM::REC_PLAY` between ESMStore (that contains dynamic records) + // and WorldModel (that can contain instances of dynamic records). Here we need to rebuild + // ESMStore index in order to be able to lookup dynamic records while loading the player and + // WorldModel. + mStore.rebuildIdsIndex(); + mStore.checkPlayer(); mPlayer->readRecord(reader, type); if (getPlayerPtr().isInCell())