1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-30 21:15:36 +00:00

Merge branch 'order_please' into 'master'

Base dialogue order solely on mPrev

Closes #6670

See merge request OpenMW/openmw!1714
This commit is contained in:
psi29a 2022-03-19 12:24:42 +00:00
commit 40b1d81050
2 changed files with 15 additions and 35 deletions

View file

@ -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,8 +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
Feature #390: 3rd person look "over the shoulder"
Feature #832: OpenMW-CS: Handle deleted references
Feature #1536: Show more information about level on menu

View file

@ -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()