Core/Creature: add a spell-focus-check method.

Port From (https://github.com/TrinityCore/TrinityCore/commit/44e9572a77061a8ddf04940f8e76f6585ad4ca05)
This commit is contained in:
hondacrx
2022-01-02 19:31:22 -05:00
parent 6a42e70544
commit 45fba1e81a
2 changed files with 70 additions and 66 deletions
+3 -1
View File
@@ -1121,7 +1121,7 @@ namespace Game.Entities
return true;
}
if (HandleSpellFocus(null, true))
if (HasSpellFocusTarget())
return true;
if (HasUnitState(UnitState.Casting))
@@ -3059,6 +3059,8 @@ namespace Game.Entities
_spellFocusDelay = (!IsPet() && withDelay) ? GameTime.GetGameTimeMS() : 0; // don't allow re-target right away to prevent visual bugs
}
public override bool HasSpellFocusTarget() { return IsAlive() && (_focusSpell != null || _spellFocusDelay != 0); }
public void MustReacquireTarget() { _shouldReacquireSpellFocusTarget = true; } // flags the Creature for forced (client displayed) target reacquisition in the next Update call
public void DoNotReacquireTarget()