From bbbcc5e4b76cf029a6debf9e37f89441c99ad234 Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Sun, 27 Nov 2022 22:23:35 +0100 Subject: [PATCH] Add an early out to dialogue loading to match Morrowind.exe behaviour --- components/esm3/loaddial.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/components/esm3/loaddial.cpp b/components/esm3/loaddial.cpp index c8ac1b40c3..5aa8a29b09 100644 --- a/components/esm3/loaddial.cpp +++ b/components/esm3/loaddial.cpp @@ -87,8 +87,14 @@ namespace ESM if (lookup != mLookup.end()) { auto it = lookup->second.first; - // Since the new version of this record may have changed the next/prev linked list connection, we need to - // re-insert the record + if (it->mPrev == info.mPrev) + { + *it = info; + lookup->second.second = isDeleted; + return; + } + // Since the new version of this record has a different prev linked list connection, we need to re-insert + // the record mInfo.erase(it); mLookup.erase(lookup); }