mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-02-20 18:10:02 +01:00
[Combat formation] Flee optimize
This commit is contained in:
parent
fe64d9ce00
commit
ff7b58082d
@ -1710,7 +1710,8 @@ Position MovementAction::BestPositionForMeleeToFlee(Position pos, float radius)
|
|||||||
bot->GetPositionY() + sin(angle) * fleeDis,
|
bot->GetPositionY() + sin(angle) * fleeDis,
|
||||||
bot->GetPositionZ()};
|
bot->GetPositionZ()};
|
||||||
if (strict && currentTarget
|
if (strict && currentTarget
|
||||||
&& fleePos.GetExactDist(currentTarget) - currentTarget->GetCombatReach() > sPlayerbotAIConfig->tooCloseDistance) {
|
&& fleePos.GetExactDist(currentTarget) - currentTarget->GetCombatReach() > sPlayerbotAIConfig->tooCloseDistance
|
||||||
|
&& bot->IsWithinMeleeRange(currentTarget)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (pos.GetExactDist(fleePos) > farestDis) {
|
if (pos.GetExactDist(fleePos) > farestDis) {
|
||||||
@ -1819,7 +1820,7 @@ bool MovementAction::CheckLastFlee(float curAngle, std::list<FleeInfo>& infoList
|
|||||||
}
|
}
|
||||||
float revAngle = fmod(info.angle + M_PI, 2 * M_PI);
|
float revAngle = fmod(info.angle + M_PI, 2 * M_PI);
|
||||||
// angle too close
|
// angle too close
|
||||||
if (fabs(revAngle - curAngle) < M_PI / 8) {
|
if (fabs(revAngle - curAngle) < M_PI / 4) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user