More scanning changes around AE cast

This commit is contained in:
Akkadius
2019-12-28 23:58:18 -06:00
parent b11528fbcc
commit 9481e9eb2d
7 changed files with 91 additions and 41 deletions
+12 -7
View File
@@ -467,35 +467,40 @@ Mob::~Mob()
AI_Stop();
if (GetPet()) {
if (GetPet()->Charmed())
if (GetPet()->Charmed()) {
GetPet()->BuffFadeByEffect(SE_Charm);
else
}
else {
SetPet(0);
}
}
EQApplicationPacket app;
CreateDespawnPacket(&app, !IsCorpse());
Corpse* corpse = entity_list.GetCorpseByID(GetID());
if(!corpse || (corpse && !corpse->IsPlayerCorpse()))
Corpse *corpse = entity_list.GetCorpseByID(GetID());
if (!corpse || (corpse && !corpse->IsPlayerCorpse())) {
entity_list.QueueClients(this, &app, true);
}
entity_list.RemoveFromTargets(this, true);
if(trade) {
if (trade) {
Mob *with = trade->With();
if(with && with->IsClient()) {
if (with && with->IsClient()) {
with->CastToClient()->FinishTrade(with);
with->trade->Reset();
}
delete trade;
}
if(HasTempPetsActive()){
if (HasTempPetsActive()) {
entity_list.DestroyTempPets(this);
}
entity_list.UnMarkNPC(GetID());
UninitializeBuffSlots();
entity_list.RemoveMobFromCloseLists(this);
#ifdef BOTS
LeaveHealRotationTargetPool();
#endif