Core/Threat: Passive creatures now properly become engaged when adding an offline threat entry. Fixes RoS and Thaddius, maybe more.

Port From (https://github.com/TrinityCore/TrinityCore/commit/9f91cf23ab8ab5f4fe35cba2e504d299248c4e60)
This commit is contained in:
hondacrx
2021-06-23 13:29:40 -04:00
parent 0e8d21bae9
commit 9631f569fa
+4 -3
View File
@@ -302,12 +302,13 @@ namespace Game.Combat
ThreatReference newRefe = new(this, target, amount);
PutThreatListRef(target.GetGUID(), newRefe);
target.GetThreatManager().PutThreatenedByMeRef(_owner.GetGUID(), newRefe);
if (!newRefe.IsOffline() && !_ownerEngaged)
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()))
{
_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);