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
+6 -3
View File
@@ -63,9 +63,12 @@ namespace Game.AI
public override void JustDied(Unit killer)
{
Player player = killer.GetCharmerOrOwnerPlayerOrPlayerItself();
if (player != null)
me.SendZoneUnderAttackMessage(player);
if (killer != null)
{
Player player = killer.GetCharmerOrOwnerPlayerOrPlayerItself();
if (player != null)
me.SendZoneUnderAttackMessage(player);
}
}
}
}