mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 01:37:37 +01:00
*Fix some crash when unit is removed.
--HG-- branch : trunk
This commit is contained in:
@@ -511,10 +511,7 @@ void Player::CleanupsBeforeDelete()
|
||||
TradeCancel(false);
|
||||
DuelComplete(DUEL_INTERUPTED);
|
||||
|
||||
if(IsInWorld()) // only for fully created Object
|
||||
{
|
||||
Unit::CleanupsBeforeDelete();
|
||||
}
|
||||
Unit::CleanupsBeforeDelete();
|
||||
|
||||
if (m_transport)
|
||||
m_transport->RemovePassenger(this);
|
||||
|
||||
@@ -11323,21 +11323,23 @@ void Unit::RemoveFromWorld()
|
||||
|
||||
void Unit::CleanupsBeforeDelete()
|
||||
{
|
||||
if(IsInWorld()) // only for fully created object
|
||||
{
|
||||
RemoveAllAuras();
|
||||
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();
|
||||
ClearComboPointHolders();
|
||||
DeleteThreatList();
|
||||
getHostilRefManager().setOnlineOfflineState(false);
|
||||
RemoveAllGameObjects();
|
||||
RemoveAllDynObjects();
|
||||
GetMotionMaster()->Clear(false); // remove different non-standard movement generators.
|
||||
assert(m_uint32Values);
|
||||
|
||||
//A unit may be in removelist and not in world, but it is still in grid
|
||||
//and may have some references during delete
|
||||
RemoveAllAuras();
|
||||
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();
|
||||
ClearComboPointHolders();
|
||||
DeleteThreatList();
|
||||
getHostilRefManager().setOnlineOfflineState(false);
|
||||
RemoveAllGameObjects();
|
||||
RemoveAllDynObjects();
|
||||
GetMotionMaster()->Clear(false); // remove different non-standard movement generators.
|
||||
|
||||
if(IsInWorld())
|
||||
RemoveFromWorld();
|
||||
}
|
||||
}
|
||||
|
||||
void Unit::UpdateCharmAI()
|
||||
|
||||
Reference in New Issue
Block a user