mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Entities: Fixed an issue where creatures would not properly assist formation members in certain scenarios. Tagging #21967.
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
|
||||
#include "Creature.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "CreatureGroups.h"
|
||||
#include "MotionMaster.h"
|
||||
#include "Player.h"
|
||||
#include "ThreatManager.h"
|
||||
@@ -383,6 +384,8 @@ void ThreatManager::AddThreat(Unit* target, float amount, SpellInfo const* spell
|
||||
SaveCreatureHomePositionIfNeed(cOwner);
|
||||
if (CreatureAI* ownerAI = cOwner->AI())
|
||||
ownerAI->JustEngagedWith(target);
|
||||
if (CreatureGroup* formation = cOwner->GetFormation())
|
||||
formation->MemberEngagingTarget(cOwner, target);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
#include "ConditionMgr.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "CreatureAIImpl.h"
|
||||
#include "CreatureGroups.h"
|
||||
#include "Formulas.h"
|
||||
#include "GameTime.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
@@ -8153,10 +8152,6 @@ void Unit::EngageWithTarget(Unit* enemy)
|
||||
m_threatManager.AddThreat(enemy, 0.0f, nullptr, true, true);
|
||||
else
|
||||
SetInCombatWith(enemy);
|
||||
|
||||
if (Creature* creature = ToCreature())
|
||||
if (CreatureGroup* formation = creature->GetFormation())
|
||||
formation->MemberEngagingTarget(creature, enemy);
|
||||
}
|
||||
|
||||
void Unit::AttackedTarget(Unit* target, bool canInitialAggro)
|
||||
|
||||
Reference in New Issue
Block a user