aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 973b2a7ea35..d2e7a1b4188 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -9537,7 +9537,14 @@ void Unit::CombatStart(Unit* target)
if(!target->isInCombat() && target->GetTypeId() != TYPEID_PLAYER
&& !((Creature*)target)->HasReactState(REACT_PASSIVE) && ((Creature*)target)->IsAIEnabled)
+ {
((Creature*)target)->AI()->AttackStart(this);
+ if(((Creature*)target)->GetFormation())
+ {
+ ((Creature*)target)->GetFormation()->MemberAttackStart((Creature*)target, this);
+ sLog.outDebug("Unit::CombatStart() calls CreatureGroups::MemberHasAttacked(this);");
+ }
+ }
SetInCombatWith(target);
target->SetInCombatWith(this);
@@ -9554,13 +9561,6 @@ void Unit::CombatStart(Unit* target)
me->UpdatePvP(true);
me->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT);
}
-
- //Call creature group update
- if(GetTypeId()==TYPEID_UNIT && ((Creature*)this)->GetFormation())
- {
- ((Creature*)this)->GetFormation()->MemberHasAttacked(*(Creature*)this);
- sLog.outDebug("Unit::CombatStart() calls CreatureGroups::MemberHasAttacked(this);");
- }
}
void Unit::SetInCombatState(bool PvP)