diff --git a/components/esm/loaddial.cpp b/components/esm/loaddial.cpp index 5adf409bb..ee7ddbfad 100644 --- a/components/esm/loaddial.cpp +++ b/components/esm/loaddial.cpp @@ -61,6 +61,15 @@ void Dialogue::addInfo(const ESM::DialInfo& info, bool merge) ESM::Dialogue::InfoContainer::iterator it = mInfo.end(); std::map::iterator lookup; + + lookup = mLookup.find(info.mId); + if (lookup != mLookup.end()) + { + it = lookup->second; + *it = info; + return; + } + lookup = mLookup.find(info.mPrev); if (lookup != mLookup.end()) { @@ -79,14 +88,6 @@ void Dialogue::addInfo(const ESM::DialInfo& info, bool merge) return; } - lookup = mLookup.find(info.mId); - if (lookup != mLookup.end()) - { - it = lookup->second; - *it = info; - return; - } - std::cerr << "Failed to insert info " << info.mId << std::endl; }