1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-30 01:15:33 +00:00

fix eraseStatic() assumptions

This commit is contained in:
greye 2013-03-17 08:36:15 +04:00
parent 83932ebfe8
commit 52ed451ae7

View file

@ -192,11 +192,14 @@ namespace MWWorld
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) {
typename std::vector<T *>::iterator end = sharedIter + mStatic.size();
while (sharedIter != mShared.end() && sharedIter != end) {
if((*sharedIter)->mId == item.mId) {
mShared.erase(sharedIter);
break;
}
++sharedIter;
}
mStatic.erase(it);
}