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:
SecretsOTheP
2013-03-23 10:04:49 -04:00
parent b0b342a020
commit fa18991917
3 changed files with 6 additions and 2 deletions
+2 -1
View File
@@ -4915,9 +4915,10 @@ void Merc::Death(Mob* killerMob, int32 damage, uint16 spell, SkillType attack_sk
if(entity_list.GetCorpseByID(GetID()))
entity_list.GetCorpseByID(GetID())->Depop();
entity_list.RemoveMerc(GetID());
if(Suspend())
{
//todo: perl event?
}
}