aim fix: conditions for failure in enemy prediction

This commit is contained in:
commandcobra7 2024-06-29 13:59:52 +03:00 committed by jeefo
commit 405955d03f
3 changed files with 3 additions and 3 deletions

View file

@ -1773,7 +1773,7 @@ void Bot::syncUpdatePredictedIndex () {
}
void Bot::updatePredictedIndex () {
if (m_lastEnemyOrigin.empty ()) {
if (m_lastEnemyOrigin.empty () || !vistab.isReady () || !util.isAlive (m_lastEnemy)) {
return; // do not run task if no last enemy
}

View file

@ -506,7 +506,7 @@ void Bot::setAimDirection () {
auto predictNode = m_lastPredictIndex;
auto isPredictedIndexApplicable = [&] () -> bool {
if (!vistab.visible (m_currentNodeIndex, predictNode) || !vistab.visible (m_previousNodes[0], predictNode)) {
if (!vistab.visible (m_currentNodeIndex, predictNode)) {
predictNode = kInvalidNodeIndex;
pathLength = kInfiniteDistanceLong;
}