Core/SmartAI: Fixed creatures using SAI not attacking its charmer after it breaks

Closes #7601
This commit is contained in:
Shauren
2013-09-09 17:44:07 +02:00
parent 79307bc884
commit be5cf42ec3

View File

@@ -699,6 +699,10 @@ void SmartAI::InitializeAI()
void SmartAI::OnCharmed(bool apply)
{
GetScript()->ProcessEventsFor(SMART_EVENT_CHARMED, NULL, 0, 0, apply);
if (!apply && !me->IsInEvadeMode() && me->GetUInt64Value(UNIT_FIELD_CHARMEDBY))
if (Unit* charmer = ObjectAccessor::GetUnit(*me, me->GetUInt64Value(UNIT_FIELD_CHARMEDBY)))
AttackStart(charmer);
}
void SmartAI::DoAction(int32 param)