mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-06 03:15:33 +00:00
fix Store<T>::eraseStatic()
This commit is contained in:
parent
3d34fea21e
commit
d30b38f336
1 changed files with 8 additions and 9 deletions
|
@ -187,18 +187,17 @@ namespace MWWorld
|
|||
T item;
|
||||
item.mId = Misc::StringUtils::lowerCase(id);
|
||||
|
||||
// delete from the static part of mShared
|
||||
typename std::vector<T *>::iterator sharedIter = mShared.begin();
|
||||
for (; sharedIter != (mShared.begin()+mStatic.size()); ++sharedIter) {
|
||||
if((*sharedIter)->mId == item.mId) {
|
||||
mShared.erase(sharedIter);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
typename std::map<std::string, T>::iterator it = mStatic.find(item.mId);
|
||||
|
||||
if (it != mStatic.end() && Misc::StringUtils::ciEqual(it->second.mId, id)) {
|
||||
// delete from the static part of mShared
|
||||
typename std::vector<T *>::iterator sharedIter = mShared.begin();
|
||||
for (; sharedIter != (mShared.begin()+mStatic.size()); ++sharedIter) {
|
||||
if((*sharedIter)->mId == item.mId) {
|
||||
mShared.erase(sharedIter);
|
||||
break;
|
||||
}
|
||||
}
|
||||
mStatic.erase(it);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue