mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-15 04:11:30 +00:00
Added a few checks to resolve dangling pointers involving Mercs. Similar to the AIYellForHelp crash fixed years ago by Rogean.
This commit is contained in:
parent
b0b342a020
commit
fa18991917
@ -188,13 +188,14 @@ bool Client::Process() {
|
|||||||
|
|
||||||
if(linkdead_timer.Check()){
|
if(linkdead_timer.Check()){
|
||||||
Save();
|
Save();
|
||||||
LeaveGroup();
|
|
||||||
if (GetMerc())
|
if (GetMerc())
|
||||||
{
|
{
|
||||||
GetMerc()->Save();
|
GetMerc()->Save();
|
||||||
|
if(GetMerc()->GetGroup != NULL)
|
||||||
GetMerc()->RemoveMercFromGroup(GetMerc(), GetMerc()->GetGroup());
|
GetMerc()->RemoveMercFromGroup(GetMerc(), GetMerc()->GetGroup());
|
||||||
GetMerc()->Depop();
|
GetMerc()->Depop();
|
||||||
}
|
}
|
||||||
|
LeaveGroup();
|
||||||
Raid *myraid = entity_list.GetRaidByClient(this);
|
Raid *myraid = entity_list.GetRaidByClient(this);
|
||||||
if (myraid)
|
if (myraid)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2760,6 +2760,8 @@ void EntityList::RemoveEntity(uint16 id)
|
|||||||
return;
|
return;
|
||||||
else if(entity_list.RemoveTrap(id))
|
else if(entity_list.RemoveTrap(id))
|
||||||
return;
|
return;
|
||||||
|
else if(entity_list.RemoveMerc(id))
|
||||||
|
return;
|
||||||
|
|
||||||
#ifdef BOTS
|
#ifdef BOTS
|
||||||
// This block of code is necessary to clean up bot objects
|
// This block of code is necessary to clean up bot objects
|
||||||
|
|||||||
@ -4915,9 +4915,10 @@ void Merc::Death(Mob* killerMob, int32 damage, uint16 spell, SkillType attack_sk
|
|||||||
if(entity_list.GetCorpseByID(GetID()))
|
if(entity_list.GetCorpseByID(GetID()))
|
||||||
entity_list.GetCorpseByID(GetID())->Depop();
|
entity_list.GetCorpseByID(GetID())->Depop();
|
||||||
|
|
||||||
|
entity_list.RemoveMerc(GetID());
|
||||||
|
|
||||||
if(Suspend())
|
if(Suspend())
|
||||||
{
|
{
|
||||||
//todo: perl event?
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user