[9981] For non-player at "offline" delete hostile references.

This must fix porblem with call message broadcast from unit destructor.
This commit is contained in:
VladimirMangos 2010-05-27 14:15:28 +04:00
parent afc9b28103
commit ce85076033
2 changed files with 5 additions and 2 deletions

View file

@ -12020,7 +12020,10 @@ void Unit::CleanupsBeforeDelete()
CombatStop();
ClearComboPointHolders();
DeleteThreatList();
getHostileRefManager().setOnlineOfflineState(false);
if (GetTypeId()==TYPEID_PLAYER)
getHostileRefManager().setOnlineOfflineState(false);
else
getHostileRefManager().deleteReferences();
RemoveAllAuras(AURA_REMOVE_BY_DELETE);
GetMotionMaster()->Clear(false); // remove different non-standard movement generators.
}