aboutsummaryrefslogtreecommitdiff
path: root/src/game/CreatureAI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/CreatureAI.cpp')
-rw-r--r--src/game/CreatureAI.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/game/CreatureAI.cpp b/src/game/CreatureAI.cpp
index 409463b0052..fa512fce726 100644
--- a/src/game/CreatureAI.cpp
+++ b/src/game/CreatureAI.cpp
@@ -36,6 +36,12 @@ void UnitAI::AttackStart(Unit *victim)
}
}
+//Enable PlayerAI when charmed
+void PlayerAI::OnCharmed(bool apply) { me->IsAIEnabled = apply; }
+
+//Disable CreatureAI when charmed
+void CreatureAI::OnCharmed(bool apply) { me->IsAIEnabled = !apply; }
+
void CreatureAI::MoveInLineOfSight(Unit *who)
{
if(!me->getVictim() && me->canStartAttack(who))