mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 08:28:32 +01:00
Core/Threat: Passive creatures now properly become engaged when adding an offline threat entry. Fixes RoS and Thaddius, maybe more. Closes #21269.
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#include "ThreatManager.h"
|
||||
#include "Unit.h"
|
||||
#include "UnitAI.h"
|
||||
#include "UnitDefines.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "SpellMgr.h"
|
||||
@@ -371,12 +372,13 @@ void ThreatManager::AddThreat(Unit* target, float amount, SpellInfo const* spell
|
||||
ThreatReference* ref = new ThreatReference(this, target, amount);
|
||||
PutThreatListRef(target->GetGUID(), ref);
|
||||
target->GetThreatManager().PutThreatenedByMeRef(_owner->GetGUID(), ref);
|
||||
if (!ref->IsOffline() && !_ownerEngaged)
|
||||
|
||||
Creature* cOwner = _owner->ToCreature();
|
||||
assert(cOwner); // if we got here the owner can have a threat list, and must be a creature!
|
||||
if (!_ownerEngaged && (cOwner->HasReactState(REACT_PASSIVE) || !ref->IsOffline()))
|
||||
{
|
||||
_ownerEngaged = true;
|
||||
|
||||
Creature* cOwner = _owner->ToCreature();
|
||||
assert(cOwner); // if we got here the owner can have a threat list, and must be a creature!
|
||||
SaveCreatureHomePositionIfNeed(cOwner);
|
||||
if (cOwner->IsAIEnabled)
|
||||
cOwner->AI()->JustEngagedWith(target);
|
||||
|
||||
Reference in New Issue
Block a user