Core/Creatures: Fixed crash when guards get killed by periodic auras whose caster is offline or despawned

Port From (https://github.com/TrinityCore/TrinityCore/commit/e539de68e10a64b0f0a0619eb5213ab5315b01c9)
This commit is contained in:
hondacrx
2022-01-05 20:25:41 -05:00
parent f8f41e303e
commit 47cfd6d419
+3
View File
@@ -62,10 +62,13 @@ namespace Game.AI
} }
public override void JustDied(Unit killer) public override void JustDied(Unit killer)
{
if (killer != null)
{ {
Player player = killer.GetCharmerOrOwnerPlayerOrPlayerItself(); Player player = killer.GetCharmerOrOwnerPlayerOrPlayerItself();
if (player != null) if (player != null)
me.SendZoneUnderAttackMessage(player); me.SendZoneUnderAttackMessage(player);
} }
} }
}
} }