mirror of
https://github.com/OpenMW/openmw.git
synced 2025-11-30 13:04:33 +00:00
Change world store insert
This commit is contained in:
parent
abb381a163
commit
64a45f8aeb
1 changed files with 6 additions and 8 deletions
|
|
@ -269,15 +269,13 @@ namespace MWWorld
|
||||||
list.push_back((*it)->mId);
|
list.push_back((*it)->mId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
template <class T, class Id>
|
template <typename T, typename Id>
|
||||||
T* TypedDynamicStore<T, Id>::insert(const T& item, bool overrideOnly)
|
T* TypedDynamicStore<T, Id>::insert(const T& item, bool /*overrideOnly*/)
|
||||||
{
|
{
|
||||||
if (overrideOnly)
|
// Check if the ID already exists in static or dynamic stores
|
||||||
{
|
auto itStatic = mStatic.find(item.mId);
|
||||||
auto it = mStatic.find(item.mId);
|
auto itDynamic = mDynamic.find(item.mId);
|
||||||
if (it == mStatic.end())
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
std::pair<typename Dynamic::iterator, bool> result = mDynamic.insert_or_assign(item.mId, item);
|
std::pair<typename Dynamic::iterator, bool> result = mDynamic.insert_or_assign(item.mId, item);
|
||||||
T* ptr = &result.first->second;
|
T* ptr = &result.first->second;
|
||||||
if (result.second)
|
if (result.second)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue