Index: src/client/pscelclient.cpp =================================================================== --- src/client/pscelclient.cpp (Revision 1944) +++ src/client/pscelclient.cpp (Arbeitskopie) @@ -15,7 +15,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Implements the varrious things relating to the CEL for the client. + * Implements the various things relating to the CEL for the client. */ #include @@ -958,6 +958,8 @@ bool unresolved = true; + iSector* sectorToBeDeleted = 0; + // Are all the sectors going to be unloaded? for(int i = 0;iGetCount();i++) { @@ -968,6 +970,8 @@ // We've found a sector that won't be unloaded so the mesh won't need to be moved unresolved = false; break; + } else { + sectorToBeDeleted = sectors->Get(i); } } @@ -976,7 +980,7 @@ // All the sectors the mesh is in are going to be unloaded Warning1(LOG_ANY,"Moving entity to temporary sector"); // put the mesh to the sector that server uses for keeping meshes located in unload maps - HandleUnresolvedPos(entities[entNum], movable->GetPosition(), 0.0f, unresSector->QueryObject ()->GetName ()); + HandleUnresolvedPos(entities[entNum], movable->GetPosition(), 0.0f, sectorToBeDeleted->QueryObject ()->GetName ()); } } } @@ -1046,8 +1050,8 @@ actor->GetMovement()->SetOnGround(false); delete *posIter; - // Deleting automatically increments the iterator. unresPos.Delete(posIter); + ++posIter; } else ++posIter; Index: src/client/pscelclient.h =================================================================== --- src/client/pscelclient.h (Revision 1944) +++ src/client/pscelclient.h (Arbeitskopie) @@ -164,7 +164,7 @@ void HandleItemEffect( const char* factName, csRef mw, bool onGround = true, const char* slot = 0, csHash *effectids = 0, csHash *lightids = 0 ); - /** Caled when new world maps were loaded + /** Called when new world maps were loaded CelClient looks for GEM Objects which have sectors with unknown name and checks if this name is known now */ void OnMapsLoaded();