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:
@@ -302,12 +302,13 @@ namespace Game.Combat
|
|||||||
ThreatReference newRefe = new(this, target, amount);
|
ThreatReference newRefe = new(this, target, amount);
|
||||||
PutThreatListRef(target.GetGUID(), newRefe);
|
PutThreatListRef(target.GetGUID(), newRefe);
|
||||||
target.GetThreatManager().PutThreatenedByMeRef(_owner.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;
|
_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);
|
SaveCreatureHomePositionIfNeed(cOwner);
|
||||||
if (cOwner.IsAIEnabled)
|
if (cOwner.IsAIEnabled)
|
||||||
cOwner.GetAI().JustEngagedWith(target);
|
cOwner.GetAI().JustEngagedWith(target);
|
||||||
|
|||||||
Reference in New Issue
Block a user