[Bug Fix] XTarget Changes Causing Crashes (#1915)

* [Bugfix] XTarget Changes Causing Crashes

Added nullptr check when processing XTargetAutoHaters for pet owner.

* [Bugfix] XTarget Changes Causing Crashes

Added another needed sanity check after the nullptr check.

* [Bugfix] XTarget Changes Causing Crashes

Added another check against nullptr.

* [Bugfix] XTarget Changes Causing Crashes

Cleaned up nullptr checks per PR comments.
This commit is contained in:
mmcgarvey 2022-01-03 22:22:21 -05:00 committed by GitHub
parent d6d4c458e7
commit 3853c4f150
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2571,7 +2571,7 @@ bool NPC::Death(Mob* killer_mob, int32 damage, uint16 spell, EQ::skills::SkillTy
entity_list.RemoveFromAutoXTargets(this);
if (killer->GetUltimateOwner() && killer->GetUltimateOwner()->IsClient()) {
if (killer != nullptr && killer->GetUltimateOwner() && killer->GetUltimateOwner()->IsClient()) {
killer->GetUltimateOwner()->CastToClient()->ProcessXTargetAutoHaters();
}
uint16 emoteid = this->GetEmoteID();