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:
Treeston
2021-10-23 14:45:40 +02:00
committed by Shauren
parent 34f9666f20
commit 00b9c23e28
2 changed files with 3 additions and 5 deletions
+3
View File
@@ -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);
}
}
-5
View File
@@ -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)