mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +00:00
Revert "It's never ogre with these hatelist crashes.."
This reverts commit dffee38dc6.
This commit is contained in:
@@ -223,7 +223,6 @@ Bot::~Bot() {
|
||||
GetPet()->Depop();
|
||||
|
||||
entity_list.RemoveBot(GetID());
|
||||
entity_list.RemoveFromTargets(this, true);
|
||||
}
|
||||
|
||||
void Bot::SetBotID(uint32 botID) {
|
||||
|
||||
+1
-2
@@ -426,8 +426,7 @@ Client::~Client() {
|
||||
//let the stream factory know were done with this stream
|
||||
eqs->Close();
|
||||
eqs->ReleaseFromUse();
|
||||
//Moved this from ~Mob, because it could cause a crash in some cases where a hate list was still used and that mob was the only one on the hate list.
|
||||
entity_list.RemoveFromTargets(this, true);
|
||||
|
||||
UninitializeBuffSlots();
|
||||
}
|
||||
|
||||
|
||||
@@ -1283,33 +1283,6 @@ void EntityList::RemoveFromTargets(Mob *mob, bool RemoveFromXTargets)
|
||||
}
|
||||
}
|
||||
|
||||
void EntityList::RemoveFromTargets(uint16 MobID, bool RemoveFromXTargets)
|
||||
{
|
||||
Mob* mob = entity_list.GetMob(MobID);
|
||||
|
||||
if(!mob)
|
||||
return;
|
||||
|
||||
auto it = mob_list.begin();
|
||||
while (it != mob_list.end()) {
|
||||
Mob *m = it->second;
|
||||
++it;
|
||||
|
||||
if (!m)
|
||||
continue;
|
||||
|
||||
m->RemoveFromHateList(mob);
|
||||
|
||||
if (RemoveFromXTargets) {
|
||||
if (m->IsClient())
|
||||
m->CastToClient()->RemoveXTarget(mob, false);
|
||||
// FadingMemories calls this function passing the client.
|
||||
else if (mob->IsClient())
|
||||
mob->CastToClient()->RemoveXTarget(m, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EntityList::RemoveFromXTargets(Mob *mob)
|
||||
{
|
||||
auto it = client_list.begin();
|
||||
|
||||
@@ -290,7 +290,6 @@ public:
|
||||
void ExpeditionWarning(uint32 minutes_left);
|
||||
|
||||
void RemoveFromTargets(Mob* mob, bool RemoveFromXTargets = false);
|
||||
void RemoveFromTargets(uint16 mob, bool RemoveFromXTargets = false);
|
||||
void RemoveFromXTargets(Mob* mob);
|
||||
void RemoveFromAutoXTargets(Mob* mob);
|
||||
void ReplaceWithTarget(Mob* pOldMob, Mob*pNewTarget);
|
||||
|
||||
@@ -205,6 +205,9 @@ void HateList::Add(Mob *ent, int32 in_hate, int32 in_dam, bool bFrenzy, bool iAd
|
||||
|
||||
bool HateList::RemoveEnt(Mob *ent)
|
||||
{
|
||||
if (!ent)
|
||||
return false;
|
||||
|
||||
bool found = false;
|
||||
auto iterator = list.begin();
|
||||
|
||||
|
||||
@@ -76,7 +76,6 @@ Merc::Merc(const NPCType* d, float x, float y, float z, float heading)
|
||||
Merc::~Merc() {
|
||||
AI_Stop();
|
||||
entity_list.RemoveMerc(this->GetID());
|
||||
entity_list.RemoveFromTargets(this, true);
|
||||
UninitializeBuffSlots();
|
||||
}
|
||||
|
||||
|
||||
@@ -401,6 +401,8 @@ Mob::~Mob()
|
||||
if(!corpse || (corpse && !corpse->IsPlayerCorpse()))
|
||||
entity_list.QueueClients(this, &app, true);
|
||||
|
||||
entity_list.RemoveFromTargets(this, true);
|
||||
|
||||
if(trade) {
|
||||
Mob *with = trade->With();
|
||||
if(with && with->IsClient()) {
|
||||
|
||||
@@ -392,8 +392,6 @@ NPC::~NPC()
|
||||
safe_delete(reface_timer);
|
||||
safe_delete(swarmInfoPtr);
|
||||
safe_delete(qGlobals);
|
||||
//Moved this from ~Mob, because it could cause a crash in some cases where a hate list was still used and that mob was the only one on the hate list.
|
||||
entity_list.RemoveFromTargets(this, true);
|
||||
UninitializeBuffSlots();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user