mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-20 17:11:33 +00:00
Workaround clang and actually erase from the vector
This commit is contained in:
parent
86c50ece92
commit
1e1ebb049e
1 changed files with 4 additions and 3 deletions
|
@ -395,17 +395,18 @@ void ESMStore::validateDynamic()
|
||||||
template<class T>
|
template<class T>
|
||||||
void ESMStore::removeMissingObjects(Store<T>& store)
|
void ESMStore::removeMissingObjects(Store<T>& store)
|
||||||
{
|
{
|
||||||
for(auto& [id, list] : store.mDynamic)
|
for(auto& entry : store.mDynamic)
|
||||||
{
|
{
|
||||||
std::remove_if(list.mList.begin(), list.mList.end(), [&] (const auto& item)
|
auto first = std::remove_if(entry.second.mList.begin(), entry.second.mList.end(), [&] (const auto& item)
|
||||||
{
|
{
|
||||||
if(!find(item.mId))
|
if(!find(item.mId))
|
||||||
{
|
{
|
||||||
Log(Debug::Verbose) << "Leveled list '" << id << "' has nonexistent object '" << item.mId << "', ignoring it.";
|
Log(Debug::Verbose) << "Leveled list '" << entry.first << "' has nonexistent object '" << item.mId << "', ignoring it.";
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
entry.second.mList.erase(first, entry.second.mList.end());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue