aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2013-09-09 17:44:07 +0200
committerShauren <shauren.trinity@gmail.com>2013-09-09 17:44:07 +0200
commitbe5cf42ec392e8526d3180e51ffaacb84e883fae (patch)
tree85357e75028e87d9ee094aa51e7b902dfe7f1092 /src
parent79307bc884e69e9f8dd60bd5a592a2a6b0a32e4a (diff)
Core/SmartAI: Fixed creatures using SAI not attacking its charmer after it breaks
Closes #7601
Diffstat (limited to 'src')
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp
index a1862c07d14..a56d0f94f2d 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.cpp
+++ b/src/server/game/AI/SmartScripts/SmartAI.cpp
@@ -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)