mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-25 03:12:09 +01:00
*Fix critter AI.
*Some AI structure change. --HG-- branch : trunk
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user