diff --git a/apps/openmw/mwrender/actors.cpp b/apps/openmw/mwrender/actors.cpp index 85217b42da..d8ca78e3a5 100644 --- a/apps/openmw/mwrender/actors.cpp +++ b/apps/openmw/mwrender/actors.cpp @@ -99,16 +99,15 @@ void Actors::removeCell(MWWorld::Ptr::CellStore* store){ mRend.getScene()->destroySceneNode(base); base = 0; } - for(std::map::iterator iter = mAllActors.begin(); iter != mAllActors.end(); ) - { - if(iter->first.getCell() == store){ - delete iter->second; - iter = mAllActors.erase(iter); - } + for(std::map::iterator iter = mAllActors.begin(); iter != mAllActors.end(); ) + { + if(iter->first.getCell() == store){ + delete iter->second; + mAllActors.erase(iter++); + } else ++iter; - } - + } } void Actors::playAnimationGroup (const MWWorld::Ptr& ptr, const std::string& groupName, int mode, int number){