From dd977765014498fd97dd89f68738e5fa2306e465 Mon Sep 17 00:00:00 2001 From: w12x Date: Mon, 27 Oct 2008 15:28:04 -0500 Subject: [svn] * Fixed startup error flood if creature model id is 0 * Fixed totems using proper model ids broken after recent change * Set pet grid activity state to that of caster upon summoning * Fix a possible crash in ObjectAccessor note to self: don't commit anything without 3 days testing. ever. after this one ofc. --HG-- branch : trunk --- src/game/ObjectAccessor.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/game/ObjectAccessor.cpp') diff --git a/src/game/ObjectAccessor.cpp b/src/game/ObjectAccessor.cpp index 631ccc7fe6b..39687e27e49 100644 --- a/src/game/ObjectAccessor.cpp +++ b/src/game/ObjectAccessor.cpp @@ -533,10 +533,15 @@ ObjectAccessor::Update(uint32 diff) // clone the active object list, because update might remove from it std::set activeobjects(i_activeobjects); - std::set::const_iterator itr; - for(itr = activeobjects.begin(); itr != activeobjects.end(); ++itr) + std::set::iterator itr, next; + for(itr = activeobjects.begin(); itr != activeobjects.end(); itr = next) { - (*itr)->GetMap()->resetMarkedCells(); + next = itr; + ++next; + if((*itr)->IsInWorld()) + (*itr)->GetMap()->resetMarkedCells(); + else + activeobjects.erase(itr); } Map *map; -- cgit v1.2.3