mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 18:36:31 +01:00
Core/SmartAI: Fixed creatures using SAI not attacking its charmer after it breaks
Closes #7601
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user