Skip to content

Commit

Permalink
Core/Entities: Fixed an issue where creatures would not properly assi…
Browse files Browse the repository at this point in the history
…st formation members in certain scenarios. Tagging #21967.
  • Loading branch information
Treeston committed Aug 28, 2018
1 parent da21ca8 commit a001bc6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 3 additions & 0 deletions src/server/game/Combat/ThreatManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#include "Creature.h"
#include "CreatureAI.h"
#include "CreatureGroups.h"
#include "MotionMaster.h"
#include "Player.h"
#include "ThreatManager.h"
Expand Down Expand Up @@ -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);
}
}

Expand Down
5 changes: 0 additions & 5 deletions src/server/game/Entities/Unit/Unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit a001bc6

Please sign in to comment.