Issue #176: made actor deregistration more robust

This commit is contained in:
Marc Zinnschlag 2012-05-24 13:21:52 +02:00
parent b494533bb2
commit c0ee382c72
2 changed files with 6 additions and 1 deletions

View file

@ -71,7 +71,10 @@ namespace MWMechanics
void Actors::removeActor (const MWWorld::Ptr& ptr)
{
mActors.erase (ptr);
std::set<MWWorld::Ptr>::iterator iter = mActors.find (ptr);
if (iter!=mActors.end())
mActors.erase (iter);
}
void Actors::dropActors (const MWWorld::Ptr::CellStore *cellStore)

View file

@ -32,6 +32,8 @@ namespace MWMechanics
void removeActor (const MWWorld::Ptr& ptr);
///< Deregister an actor for stats management
///
/// \note Ignored, if \a ptr is not a registered actor.
void dropActors (const MWWorld::Ptr::CellStore *cellStore);
///< Deregister all actors in the given cell.