diff options
author | raczman <none@none> | 2009-04-15 15:46:02 +0200 |
---|---|---|
committer | raczman <none@none> | 2009-04-15 15:46:02 +0200 |
commit | 4fb720c7d151951942061faa6e6fe166fbf7253e (patch) | |
tree | 062ca461117f356cfd9d74770a94f2871e2e0104 /src/game/Unit.cpp | |
parent | c97a4519c58584e6da7fe3b5e3bbdd09fcbaa782 (diff) |
Update to creature formations.
This is a big merge, it may cause problems. Use with caution, report bugs.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r-- | src/game/Unit.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 6e7a2302c9f..468859726e1 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -9496,7 +9496,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); @@ -9514,13 +9521,6 @@ void Unit::CombatStart(Unit* target) me->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT); } - //Call creature group update - if(GetTypeId()==TYPEID_UNIT && ((Creature*)this)->GetFormationID()) - { - CreatureGroupHolderType::iterator itr = CreatureGroupHolder.find(((Creature*)this)->GetFormationID()); - if(itr != CreatureGroupHolder.end()) - itr->second->MemberHasAttacked(((Creature*)this)); - } } void Unit::SetInCombatState(bool PvP) |