mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-25 20:41:33 +00:00
Merge branch 'esm_store_find_static' into 'master'
Store static id key in lower case See merge request OpenMW/openmw!1750
This commit is contained in:
commit
8f04be8e20
3 changed files with 13 additions and 4 deletions
|
@ -440,7 +440,10 @@ namespace MWRender
|
||||||
if (moved)
|
if (moved)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (std::find(cell->mMovedRefs.begin(), cell->mMovedRefs.end(), ref.mRefNum) != cell->mMovedRefs.end()) continue;
|
if (std::find(cell->mMovedRefs.begin(), cell->mMovedRefs.end(), ref.mRefNum) != cell->mMovedRefs.end())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
Misc::StringUtils::lowerCaseInPlace(ref.mRefID);
|
||||||
int type = store.findStatic(ref.mRefID);
|
int type = store.findStatic(ref.mRefID);
|
||||||
if (!typeFilter(type,size>=2)) continue;
|
if (!typeFilter(type,size>=2)) continue;
|
||||||
if (deleted) { refs.erase(ref.mRefNum); continue; }
|
if (deleted) { refs.erase(ref.mRefNum); continue; }
|
||||||
|
@ -454,7 +457,12 @@ namespace MWRender
|
||||||
}
|
}
|
||||||
for (auto [ref, deleted] : cell->mLeasedRefs)
|
for (auto [ref, deleted] : cell->mLeasedRefs)
|
||||||
{
|
{
|
||||||
if (deleted) { refs.erase(ref.mRefNum); continue; }
|
if (deleted)
|
||||||
|
{
|
||||||
|
refs.erase(ref.mRefNum);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
Misc::StringUtils::lowerCaseInPlace(ref.mRefID);
|
||||||
int type = store.findStatic(ref.mRefID);
|
int type = store.findStatic(ref.mRefID);
|
||||||
if (!typeFilter(type,size>=2)) continue;
|
if (!typeFilter(type,size>=2)) continue;
|
||||||
refs[ref.mRefNum] = std::move(ref);
|
refs[ref.mRefNum] = std::move(ref);
|
||||||
|
|
|
@ -257,7 +257,8 @@ void ESMStore::setUp(bool validateRecords)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mStaticIds.empty())
|
if (mStaticIds.empty())
|
||||||
mStaticIds = mIds;
|
for (const auto& [k, v] : mIds)
|
||||||
|
mStaticIds.emplace(Misc::StringUtils::lowerCase(k), v);
|
||||||
|
|
||||||
mSkills.setUp();
|
mSkills.setUp();
|
||||||
mMagicEffects.setUp();
|
mMagicEffects.setUp();
|
||||||
|
|
|
@ -77,7 +77,7 @@ namespace MWWorld
|
||||||
// maps the id name to the record type.
|
// maps the id name to the record type.
|
||||||
using IDMap = std::unordered_map<std::string, int, Misc::StringUtils::CiHash, Misc::StringUtils::CiEqual>;
|
using IDMap = std::unordered_map<std::string, int, Misc::StringUtils::CiHash, Misc::StringUtils::CiEqual>;
|
||||||
IDMap mIds;
|
IDMap mIds;
|
||||||
IDMap mStaticIds;
|
std::unordered_map<std::string, int> mStaticIds;
|
||||||
|
|
||||||
std::unordered_map<std::string, int> mRefCount;
|
std::unordered_map<std::string, int> mRefCount;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue