mirror of
https://github.com/OpenMW/openmw.git
synced 2025-11-30 06:34: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);
|
||||
}
|
||||
}
|
||||
template <class T, class Id>
|
||||
T* TypedDynamicStore<T, Id>::insert(const T& item, bool overrideOnly)
|
||||
template <typename T, typename Id>
|
||||
T* TypedDynamicStore<T, Id>::insert(const T& item, bool /*overrideOnly*/)
|
||||
{
|
||||
if (overrideOnly)
|
||||
{
|
||||
auto it = mStatic.find(item.mId);
|
||||
if (it == mStatic.end())
|
||||
return nullptr;
|
||||
}
|
||||
// Check if the ID already exists in static or dynamic stores
|
||||
auto itStatic = mStatic.find(item.mId);
|
||||
auto itDynamic = mDynamic.find(item.mId);
|
||||
|
||||
std::pair<typename Dynamic::iterator, bool> result = mDynamic.insert_or_assign(item.mId, item);
|
||||
T* ptr = &result.first->second;
|
||||
if (result.second)
|
||||
|
|
|
|||
Loading…
Reference in a new issue