mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-08-03 15:27:13 -04:00
Change world store insert
This commit is contained in:
parent
abb381a163
commit
64a45f8aeb
@ -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…
x
Reference in New Issue
Block a user