mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-13 17:09:08 +00:00
Fix melee reach target
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
|
||||
bool ReachTargetAction::Execute(Event event)
|
||||
{
|
||||
return MoveTo(AI_VALUE(Unit*, GetTargetName()), distance);
|
||||
return ReachCombatTo(AI_VALUE(Unit*, GetTargetName()), distance);
|
||||
}
|
||||
|
||||
bool ReachTargetAction::isUseful()
|
||||
@@ -19,8 +19,9 @@ bool ReachTargetAction::isUseful()
|
||||
if (bot->GetCurrentSpell(CURRENT_CHANNELED_SPELL) != nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return AI_VALUE2(float, "distance", GetTargetName()) > (distance + sPlayerbotAIConfig->contactDistance);
|
||||
Unit* target = GetTarget();
|
||||
// float dis = distance + CONTACT_DISTANCE;
|
||||
return target && !bot->IsWithinCombatRange(target, distance); // sServerFacade->IsDistanceGreaterThan(AI_VALUE2(float, "distance", GetTargetName()), distance);
|
||||
}
|
||||
|
||||
std::string const ReachTargetAction::GetTargetName()
|
||||
|
||||
Reference in New Issue
Block a user