From 3b8b5aee39f37c242ca1f513fda5706bbe0ae753 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 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/components/esm3/loaddial.cpp b/components/esm3/loaddial.cpp index f1c102250d..111411b008 100644 --- a/components/esm3/loaddial.cpp +++ b/components/esm3/loaddial.cpp @@ -89,7 +89,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); }