From 8787c00ca3eda49410cf9ecf2df53c2061628afd Mon Sep 17 00:00:00 2001 From: megamage Date: Thu, 5 Mar 2009 18:48:56 -0600 Subject: *Disable charmed/possessed creature AI. *Use general react states to replace charminfo react states. --HG-- branch : trunk --- src/game/CreatureAI.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/game/CreatureAI.cpp') 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)) -- cgit v1.2.3