--HG--
branch : trunk
This commit is contained in:
megamage
2009-04-06 20:40:18 -05:00
13 changed files with 251 additions and 191 deletions

View File

@@ -9541,7 +9541,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);
@@ -9558,14 +9565,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)->GetFormationID())
{
CreatureGroupHolderType::iterator itr = CreatureGroupHolder.find(((Creature*)this)->GetFormationID());
if(itr != CreatureGroupHolder.end())
itr->second->MemberHasAttacked(((Creature*)this));
}
}
void Unit::SetInCombatState(bool PvP)