Entities/Creature: Fix an edge case assertion failure with pets dying in specific situations while casting spells.

Port From (https://github.com/TrinityCore/TrinityCore/commit/97bf9278a8d347badc85d7bcefdba0c1afb275e3)
This commit is contained in:
hondacrx
2022-01-04 17:56:58 -05:00
parent c2bc3a9144
commit 021f342502
+1 -1
View File
@@ -2981,7 +2981,7 @@ namespace Game.Entities
public override bool HasSpellFocus(Spell focusSpell = null)
{
if (!IsAlive()) // dead creatures cannot focus
if (IsDead()) // dead creatures cannot focus
{
if (_spellFocusInfo.Spell != null || _spellFocusInfo.Delay != 0)
Log.outWarn(LogFilter.Unit, $"Creature '{GetName()}' (entry {GetEntry()}) has spell focus (spell id {(_spellFocusInfo.Spell != null ? _spellFocusInfo.Spell.GetSpellInfo().Id : 0)}, delay {_spellFocusInfo.Delay}ms) despite being dead.");