From 484a7c7b7ebcaefba3003a1bb50029232cd3a498 Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Wed, 16 Mar 2022 18:09:21 +0100 Subject: [PATCH 1/2] Base dialogue order solely on mPrev --- CHANGELOG.md | 1 + components/esm3/loaddial.cpp | 45 ++++++++++-------------------------- 2 files changed, 13 insertions(+), 33 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 085eaedaf9..b5bd4d8923 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -279,6 +279,7 @@ Bug #6294: Game crashes with empty pathgrid Bug #6606: Quests with multiple IDs cannot always be restarted Bug #6655: Constant effect absorb attribute causes the game to break + Bug #6670: Dialogue order is incorrect Feature #390: 3rd person look "over the shoulder" Feature #832: OpenMW-CS: Handle deleted references Feature #1536: Show more information about level on menu diff --git a/components/esm3/loaddial.cpp b/components/esm3/loaddial.cpp index 0c985def5b..a4b21cd1b3 100644 --- a/components/esm3/loaddial.cpp +++ b/components/esm3/loaddial.cpp @@ -86,49 +86,28 @@ namespace ESM return; } - InfoContainer::iterator it = mInfo.end(); - - LookupMap::iterator lookup; - lookup = mLookup.find(info.mId); + LookupMap::iterator lookup = mLookup.find(info.mId); if (lookup != mLookup.end()) { - it = lookup->second.first; + 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 mInfo.erase(it); mLookup.erase(lookup); } - if (info.mNext.empty()) + if (!info.mPrev.empty()) { - mLookup[info.mId] = std::make_pair(mInfo.insert(mInfo.end(), info), isDeleted); - return; + lookup = mLookup.find(info.mPrev); + if (lookup != mLookup.end()) + { + auto it = lookup->second.first; + + mLookup[info.mId] = std::make_pair(mInfo.insert(++it, info), isDeleted); + return; + } } - if (info.mPrev.empty()) - { - mLookup[info.mId] = std::make_pair(mInfo.insert(mInfo.begin(), info), isDeleted); - return; - } - - lookup = mLookup.find(info.mPrev); - if (lookup != mLookup.end()) - { - it = lookup->second.first; - - mLookup[info.mId] = std::make_pair(mInfo.insert(++it, info), isDeleted); - return; - } - - lookup = mLookup.find(info.mNext); - if (lookup != mLookup.end()) - { - it = lookup->second.first; - - mLookup[info.mId] = std::make_pair(mInfo.insert(it, info), isDeleted); - return; - } - - Log(Debug::Warning) << "Warning: Failed to insert info " << info.mId; + mLookup[info.mId] = std::make_pair(mInfo.insert(mInfo.begin(), info), isDeleted); } void Dialogue::clearDeletedInfos() From 12f6530ab320d02ac3dd6a49b7d571d415f31f2e Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Wed, 16 Mar 2022 19:24:36 +0100 Subject: [PATCH 2/2] Relocate changelog entries --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b5bd4d8923..f6eb3f5738 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -104,6 +104,9 @@ Bug #6544: Far from world origin objects jitter when camera is still Bug #6559: Weapon condition inconsistency between melee and ranged critical / sneak / KO attacks Bug #6579: OpenMW compilation error when using OSG doubles for BoundingSphere + Bug #6606: Quests with multiple IDs cannot always be restarted + Bug #6655: Constant effect absorb attribute causes the game to break + Bug #6670: Dialogue order is incorrect Feature #890: OpenMW-CS: Column filtering Feature #1465: "Reset" argument for AI functions Feature #2491: Ability to make OpenMW "portable" @@ -277,9 +280,6 @@ Bug #6142: Groundcover plugins change cells flags Bug #6276: Deleted groundcover instances are not deleted in game Bug #6294: Game crashes with empty pathgrid - Bug #6606: Quests with multiple IDs cannot always be restarted - Bug #6655: Constant effect absorb attribute causes the game to break - Bug #6670: Dialogue order is incorrect Feature #390: 3rd person look "over the shoulder" Feature #832: OpenMW-CS: Handle deleted references Feature #1536: Show more information about level on menu