From a8e8bd1d288d645414324353628cea3d1395bfce Mon Sep 17 00:00:00 2001 From: megamage Date: Tue, 9 Jun 2009 19:53:25 -0500 Subject: *Fix a crash caused by 3881. Please do not use any revs between this and 3881. --HG-- branch : trunk --- src/game/Map.cpp | 10 +++++----- src/game/Unit.cpp | 5 +++-- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/game/Map.cpp b/src/game/Map.cpp index e798a022671..a52b5138829 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -601,9 +601,8 @@ void Map::RelocationNotify() } } for(std::vector::iterator iter = i_unitsToNotify.begin(); iter != i_unitsToNotify.end(); ++iter) - { - (*iter)->m_Notified = false; - } + if(*iter) + (*iter)->m_Notified = false; i_unitsToNotify.clear(); i_lock = false; @@ -2130,8 +2129,9 @@ inline void Map::setNGrid(NGridType *grid, uint32 x, uint32 y) void Map::DoDelayedMovesAndRemoves() { - MoveAllCreaturesInMoveList(); - RemoveAllObjectsInRemoveList(); + //MoveAllCreaturesInMoveList(); + //RemoveAllObjectsInRemoveList(); + RelocationNotify(); } void Map::AddObjectToRemoveList(WorldObject *obj) diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 391e726596f..f014448bdb5 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -11682,7 +11682,8 @@ void Unit::AddToWorld() { WorldObject::AddToWorld(); m_Notified = false; - assert(m_NotifyListPos < 0); + //assert(m_NotifyListPos < 0); instance : crash + m_NotifyListPos = -1; SetToNotify(); } } @@ -13233,7 +13234,7 @@ bool Unit::HandleAuraRaidProcFromCharge( AuraEffect* triggeredByAura ) void Unit::SetToNotify() { // it is called somewhere when obj is not in world (crash when log in instance) - if(m_NotifyListPos < 0 && IsInWorld()) + if(m_NotifyListPos < 0) GetMap()->AddUnitToNotify(this); } -- cgit v1.2.3