diff options
Diffstat (limited to 'src/game/NullCreatureAI.cpp')
-rw-r--r-- | src/game/NullCreatureAI.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/game/NullCreatureAI.cpp b/src/game/NullCreatureAI.cpp index 4c1cb592967..67839ab9315 100644 --- a/src/game/NullCreatureAI.cpp +++ b/src/game/NullCreatureAI.cpp @@ -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(); +} |