Combat/Threat: Now set engaged state for all units on offline reference registration (vanished/invis'd units). For non-PASSIVE units, this will immediately cause an evade.

Port From (https://github.com/TrinityCore/TrinityCore/commit/fdc1c5b6c952262f98f15f35dcf19fe293c65d5b)
This commit is contained in:
hondacrx
2021-06-23 15:14:51 -04:00
parent f070f7a408
commit 7cbfcf9949
+3 -3
View File
@@ -303,12 +303,12 @@ namespace Game.Combat
PutThreatListRef(target.GetGUID(), newRefe);
target.GetThreatManager().PutThreatenedByMeRef(_owner.GetGUID(), newRefe);
Creature cOwner = _owner.ToCreature();
Cypher.Assert(cOwner != null); // if we got here the owner can have a threat list, and must be a creature!
if (!_ownerEngaged && (cOwner.HasReactState(ReactStates.Passive) || !newRefe.IsOffline()))
if (!_ownerEngaged)
{
_ownerEngaged = true;
Creature cOwner = _owner.ToCreature();
Cypher.Assert(cOwner != null); // if we got here the owner can have a threat list, and must be a creature!
SaveCreatureHomePositionIfNeed(cOwner);
if (cOwner.IsAIEnabled)
cOwner.GetAI().JustEngagedWith(target);