mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-17 22:51:30 +00:00
More hatelist fixes. Trying to nail the crash :S
This commit is contained in:
parent
dffee38dc6
commit
dd1f5f6a11
@ -223,6 +223,7 @@ Bot::~Bot() {
|
|||||||
GetPet()->Depop();
|
GetPet()->Depop();
|
||||||
|
|
||||||
entity_list.RemoveBot(GetID());
|
entity_list.RemoveBot(GetID());
|
||||||
|
entity_list.RemoveFromTargets(GetID(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bot::SetBotID(uint32 botID) {
|
void Bot::SetBotID(uint32 botID) {
|
||||||
|
|||||||
@ -426,7 +426,8 @@ Client::~Client() {
|
|||||||
//let the stream factory know were done with this stream
|
//let the stream factory know were done with this stream
|
||||||
eqs->Close();
|
eqs->Close();
|
||||||
eqs->ReleaseFromUse();
|
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(GetID(), true);
|
||||||
UninitializeBuffSlots();
|
UninitializeBuffSlots();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2107,9 +2107,6 @@ bool EntityList::RemoveMob(uint16 delete_id)
|
|||||||
if (delete_id == 0)
|
if (delete_id == 0)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
//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(delete_id, true);
|
|
||||||
|
|
||||||
auto it = mob_list.find(delete_id);
|
auto it = mob_list.find(delete_id);
|
||||||
if (it != mob_list.end()) {
|
if (it != mob_list.end()) {
|
||||||
if (npc_list.count(delete_id))
|
if (npc_list.count(delete_id))
|
||||||
@ -2131,9 +2128,6 @@ bool EntityList::RemoveMob(Mob *delete_mob)
|
|||||||
if (delete_mob == 0)
|
if (delete_mob == 0)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
//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(delete_mob, true);
|
|
||||||
|
|
||||||
auto it = mob_list.begin();
|
auto it = mob_list.begin();
|
||||||
while (it != mob_list.end()) {
|
while (it != mob_list.end()) {
|
||||||
if (it->second == delete_mob) {
|
if (it->second == delete_mob) {
|
||||||
|
|||||||
@ -205,9 +205,6 @@ void HateList::Add(Mob *ent, int32 in_hate, int32 in_dam, bool bFrenzy, bool iAd
|
|||||||
|
|
||||||
bool HateList::RemoveEnt(Mob *ent)
|
bool HateList::RemoveEnt(Mob *ent)
|
||||||
{
|
{
|
||||||
if (!ent)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
bool found = false;
|
bool found = false;
|
||||||
auto iterator = list.begin();
|
auto iterator = list.begin();
|
||||||
|
|
||||||
@ -215,10 +212,12 @@ bool HateList::RemoveEnt(Mob *ent)
|
|||||||
{
|
{
|
||||||
if((*iterator)->ent == ent)
|
if((*iterator)->ent == ent)
|
||||||
{
|
{
|
||||||
|
if(ent)
|
||||||
parse->EventNPC(EVENT_HATE_LIST, owner->CastToNPC(), ent, "0", 0);
|
parse->EventNPC(EVENT_HATE_LIST, owner->CastToNPC(), ent, "0", 0);
|
||||||
found = true;
|
found = true;
|
||||||
|
|
||||||
if(ent->IsClient())
|
|
||||||
|
if(ent && ent->IsClient())
|
||||||
ent->CastToClient()->DecrementAggroCount();
|
ent->CastToClient()->DecrementAggroCount();
|
||||||
|
|
||||||
delete (*iterator);
|
delete (*iterator);
|
||||||
|
|||||||
@ -76,6 +76,7 @@ Merc::Merc(const NPCType* d, float x, float y, float z, float heading)
|
|||||||
Merc::~Merc() {
|
Merc::~Merc() {
|
||||||
AI_Stop();
|
AI_Stop();
|
||||||
entity_list.RemoveMerc(this->GetID());
|
entity_list.RemoveMerc(this->GetID());
|
||||||
|
entity_list.RemoveFromTargets(GetID(), true);
|
||||||
UninitializeBuffSlots();
|
UninitializeBuffSlots();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -392,6 +392,8 @@ NPC::~NPC()
|
|||||||
safe_delete(reface_timer);
|
safe_delete(reface_timer);
|
||||||
safe_delete(swarmInfoPtr);
|
safe_delete(swarmInfoPtr);
|
||||||
safe_delete(qGlobals);
|
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(GetID(), true);
|
||||||
UninitializeBuffSlots();
|
UninitializeBuffSlots();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user