*Prevent assertion fail in Unit::_AddAura after creature add to remove list.
--HG-- branch : trunk
This commit is contained in:
@@ -71,7 +71,7 @@ GameObject::~GameObject()
|
||||
// CleanupsBeforeDelete();
|
||||
}
|
||||
|
||||
void GameObject::CleanupsBeforeDelete()
|
||||
void GameObject::CleanupsBeforeDelete(bool finalCleanup)
|
||||
{
|
||||
if(m_uint32Values) // field array can be not exist if GameOBject not loaded
|
||||
{
|
||||
|
||||
@@ -589,7 +589,7 @@ class TRINITY_DLL_SPEC GameObject : public WorldObject, public GridObject<GameOb
|
||||
|
||||
void AddToWorld();
|
||||
void RemoveFromWorld();
|
||||
void CleanupsBeforeDelete();
|
||||
void CleanupsBeforeDelete(bool finalCleanup = true);
|
||||
|
||||
bool Create(uint32 guidlow, uint32 name_id, Map *map, uint32 phaseMask, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 animprogress, GOState go_state, uint32 artKit = 0);
|
||||
void Update(uint32 p_time);
|
||||
|
||||
+1
-1
@@ -2357,7 +2357,7 @@ void Map::AddObjectToRemoveList(WorldObject *obj)
|
||||
{
|
||||
assert(obj->GetMapId()==GetId() && obj->GetInstanceId()==GetInstanceId());
|
||||
|
||||
obj->CleanupsBeforeDelete(); // remove or simplify at least cross referenced links
|
||||
obj->CleanupsBeforeDelete(false); // remove or simplify at least cross referenced links
|
||||
|
||||
i_objectsToRemove.insert(obj);
|
||||
//sLog.outDebug("Object (GUID: %u TypeId: %u ) added to removing list.",obj->GetGUIDLow(),obj->GetTypeId());
|
||||
|
||||
+1
-1
@@ -1165,7 +1165,7 @@ void WorldObject::setActive( bool on )
|
||||
}
|
||||
}
|
||||
|
||||
void WorldObject::CleanupsBeforeDelete()
|
||||
void WorldObject::CleanupsBeforeDelete(bool finalCleanup)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -571,7 +571,7 @@ class TRINITY_DLL_SPEC WorldObject : public Object, public WorldLocation
|
||||
|
||||
bool IsInBetween(const WorldObject *obj1, const WorldObject *obj2, float size = 0) const;
|
||||
|
||||
virtual void CleanupsBeforeDelete(); // used in destructor or explicitly before mass creature delete to remove cross-references to already deleted units
|
||||
virtual void CleanupsBeforeDelete(bool finalCleanup = true); // used in destructor or explicitly before mass creature delete to remove cross-references to already deleted units
|
||||
|
||||
virtual void SendMessageToSet(WorldPacket *data, bool self);
|
||||
virtual void SendMessageToSetInRange(WorldPacket *data, float dist, bool self);
|
||||
|
||||
+2
-2
@@ -542,12 +542,12 @@ Player::~Player ()
|
||||
sWorld.DecreasePlayerCount();
|
||||
}
|
||||
|
||||
void Player::CleanupsBeforeDelete()
|
||||
void Player::CleanupsBeforeDelete(bool finalCleanup)
|
||||
{
|
||||
TradeCancel(false);
|
||||
DuelComplete(DUEL_INTERUPTED);
|
||||
|
||||
Unit::CleanupsBeforeDelete();
|
||||
Unit::CleanupsBeforeDelete(finalCleanup);
|
||||
|
||||
if (m_transport)
|
||||
m_transport->RemovePassenger(this);
|
||||
|
||||
+1
-1
@@ -970,7 +970,7 @@ class TRINITY_DLL_SPEC Player : public Unit, public GridObject<Player>
|
||||
explicit Player (WorldSession *session);
|
||||
~Player ( );
|
||||
|
||||
void CleanupsBeforeDelete();
|
||||
void CleanupsBeforeDelete(bool finalCleanup = true);
|
||||
|
||||
static UpdateMask updateVisualBits;
|
||||
static void InitVisibleBits();
|
||||
|
||||
+5
-2
@@ -12961,7 +12961,7 @@ void Unit::RemoveFromWorld()
|
||||
}
|
||||
}
|
||||
|
||||
void Unit::CleanupsBeforeDelete()
|
||||
void Unit::CleanupsBeforeDelete(bool finalCleanup)
|
||||
{
|
||||
if (IsInWorld())
|
||||
RemoveFromWorld();
|
||||
@@ -12971,7 +12971,10 @@ void Unit::CleanupsBeforeDelete()
|
||||
//A unit may be in removelist and not in world, but it is still in grid
|
||||
//and may have some references during delete
|
||||
RemoveAllAuras();
|
||||
m_cleanupDone = true;
|
||||
|
||||
if (finalCleanup)
|
||||
m_cleanupDone = true;
|
||||
|
||||
InterruptNonMeleeSpells(true);
|
||||
m_Events.KillAllEvents(false); // non-delatable (currently casted spells) will not deleted now but it will deleted at call in Map::RemoveAllObjectsInRemoveList
|
||||
CombatStop();
|
||||
|
||||
+1
-1
@@ -1101,7 +1101,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
|
||||
void AddToWorld();
|
||||
void RemoveFromWorld();
|
||||
|
||||
void CleanupsBeforeDelete(); // used in ~Creature/~Player (or before mass creature delete to remove cross-references to already deleted units)
|
||||
void CleanupsBeforeDelete(bool finalCleanup = true); // used in ~Creature/~Player (or before mass creature delete to remove cross-references to already deleted units)
|
||||
|
||||
DiminishingLevels GetDiminishing(DiminishingGroup group);
|
||||
void IncrDiminishing(DiminishingGroup group);
|
||||
|
||||
Reference in New Issue
Block a user