Merge pull request #8739 from MrSmite/PetAI_CanAttack_bugfix

Fix a minor PetAI behavioral issue
This commit is contained in:
Subv committed 2012-12-22 09:23:55 -08:00
commit 3f4c6a9d45
1 file changed
+4 -1
+4 -1
View File
@@ -12106,7 +12106,10 @@ void Unit::CombatStart(Unit* target, bool initialAggro)
if (!target->isInCombat() && target->GetTypeId() != TYPEID_PLAYER
&& !target->ToCreature()->HasReactState(REACT_PASSIVE) && target->ToCreature()->IsAIEnabled)
{
target->ToCreature()->AI()->AttackStart(this);
if (target->isPet())
target->ToCreature()->AI()->AttackedBy(this); // PetAI has special handler before AttackStart()
else
target->ToCreature()->AI()->AttackStart(this);
}
SetInCombatWith(target);