*Fix critter AI.

*Some AI structure change.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-01-28 20:16:11 -06:00
parent 3a229014dc
commit 30c5bff102
21 changed files with 97 additions and 53 deletions

View File

@@ -19,7 +19,21 @@
*/
#include "NullCreatureAI.h"
#include "Creature.h"
NullCreatureAI::~NullCreatureAI()
{
}
void CritterAI::DamageTaken(Unit *done_by, uint32 &)
{
if(!me->hasUnitState(UNIT_STAT_FLEEING))
me->SetControlled(true, UNIT_STAT_FLEEING);
}
void CritterAI::EnterEvadeMode()
{
if(me->hasUnitState(UNIT_STAT_FLEEING))
me->SetControlled(false, UNIT_STAT_FLEEING);
CreatureAI::EnterEvadeMode();
}