mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 17:27:36 +01:00
*Use updatecombatstate to replace updatevictim. This should fix the bug of MoveSeekAssistance is replace by MoveChase immediately. Thanks to totoro
--HG-- branch : trunk
This commit is contained in:
@@ -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())
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user