mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-02-20 18:10:02 +01:00
Better tank target selection (#996)
This commit is contained in:
parent
419e96e5aa
commit
0a76fc1d5f
@ -87,12 +87,12 @@ public:
|
|||||||
float new_dis = bot->GetDistance(new_unit);
|
float new_dis = bot->GetDistance(new_unit);
|
||||||
float old_dis = bot->GetDistance(old_unit);
|
float old_dis = bot->GetDistance(old_unit);
|
||||||
// hasAggro? -> withinMelee? -> threat
|
// hasAggro? -> withinMelee? -> threat
|
||||||
if (GetIntervalLevel(new_unit) > GetIntervalLevel(old_unit))
|
if (GetIntervalLevel(new_unit) != GetIntervalLevel(old_unit))
|
||||||
{
|
{
|
||||||
return true;
|
return GetIntervalLevel(new_unit) > GetIntervalLevel(old_unit);
|
||||||
}
|
}
|
||||||
int32_t interval = GetIntervalLevel(new_unit);
|
int32_t interval = GetIntervalLevel(new_unit);
|
||||||
if (interval == 1)
|
if (interval == 2)
|
||||||
{
|
{
|
||||||
return new_dis < old_dis;
|
return new_dis < old_dis;
|
||||||
}
|
}
|
||||||
@ -101,6 +101,10 @@ public:
|
|||||||
int32_t GetIntervalLevel(Unit* unit)
|
int32_t GetIntervalLevel(Unit* unit)
|
||||||
{
|
{
|
||||||
if (!botAI->HasAggro(unit))
|
if (!botAI->HasAggro(unit))
|
||||||
|
{
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
if (botAI->GetBot()->IsWithinMeleeRange(unit))
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user