From 9631f569faeecf03cc1fdb5aa670edd450e9aab7 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Wed, 23 Jun 2021 13:29:40 -0400 Subject: [PATCH] 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) --- Source/Game/Combat/ThreatManager.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/Game/Combat/ThreatManager.cs b/Source/Game/Combat/ThreatManager.cs index 03ce0dc50..ce5d791ae 100644 --- a/Source/Game/Combat/ThreatManager.cs +++ b/Source/Game/Combat/ThreatManager.cs @@ -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);