Core/Entities: Fixed an issue where creatures would not properly assist formation members in certain scenarios. Tagging #21967.
(cherry picked from commit a001bc63b1182babddbb188f7c762c6168a98b5c)
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
#include "Creature.h"
|
||||
#include "CombatPackets.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "CreatureGroups.h"
|
||||
#include "MotionMaster.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "Player.h"
|
||||
@@ -391,6 +392,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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
#include "CreatureAI.h"
|
||||
#include "CreatureAIImpl.h"
|
||||
#include "CreatureAIFactory.h"
|
||||
#include "CreatureGroups.h"
|
||||
#include "DB2Stores.h"
|
||||
#include "Formulas.h"
|
||||
#include "GameTime.h"
|
||||
@@ -7682,10 +7681,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