diff options
-rw-r--r-- | src/game/CreatureAI.cpp | 20 | ||||
-rw-r--r-- | src/game/CreatureAIImpl.h | 42 |
2 files changed, 42 insertions, 20 deletions
diff --git a/src/game/CreatureAI.cpp b/src/game/CreatureAI.cpp index 53d9286fba7..a3a903c23a6 100644 --- a/src/game/CreatureAI.cpp +++ b/src/game/CreatureAI.cpp @@ -125,26 +125,6 @@ void CreatureAI::SelectNearestTarget(Unit *who) } } -bool CreatureAI::UpdateCombatState() -{ - if(!me->isInCombat()) - return false; - - if(!me->HasReactState(REACT_PASSIVE)) - { - if(Unit *victim = me->SelectVictim()) - AttackStart(victim); - return me->getVictim(); - } - else if(me->getThreatManager().isThreatListEmpty()) - { - EnterEvadeMode(); - return false; - } - - return true; -} - void CreatureAI::EnterEvadeMode() { if(!_EnterEvadeMode()) diff --git a/src/game/CreatureAIImpl.h b/src/game/CreatureAIImpl.h index 2ed0219ad6a..09efb138574 100644 --- a/src/game/CreatureAIImpl.h +++ b/src/game/CreatureAIImpl.h @@ -287,6 +287,47 @@ inline bool CreatureAI::UpdateVictimWithGaze() return me->getVictim(); } +inline bool CreatureAI::UpdateCombatState() +{ + if(!me->isInCombat()) + return false; + + if(!me->HasReactState(REACT_PASSIVE)) + { + if(Unit *victim = me->SelectVictim()) + AttackStart(victim); + return me->getVictim(); + } + else if(me->getThreatManager().isThreatListEmpty()) + { + EnterEvadeMode(); + return false; + } + + return true; +} + +inline bool CreatureAI::UpdateVictim() +{ + if(!me->isInCombat()) + return false; + + if(!me->HasReactState(REACT_PASSIVE)) + { + if(Unit *victim = me->SelectVictim()) + AttackStart(victim); + return me->getVictim(); + } + else if(me->getThreatManager().isThreatListEmpty()) + { + EnterEvadeMode(); + return false; + } + + return true; +} + +/* inline bool CreatureAI::UpdateVictim() { if(!me->isInCombat()) @@ -295,6 +336,7 @@ inline bool CreatureAI::UpdateVictim() AttackStart(victim); return me->getVictim(); } +*/ inline bool CreatureAI::_EnterEvadeMode() { |