From 405955d03f442513853a689cbaaaeaff5a104234 Mon Sep 17 00:00:00 2001 From: commandcobra7 <91374215+commandcobra7@users.noreply.github.com> Date: Sat, 29 Jun 2024 13:59:52 +0300 Subject: [PATCH] aim fix: conditions for failure in enemy prediction --- inc/graph.h | 2 +- src/botlib.cpp | 2 +- src/vision.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/inc/graph.h b/inc/graph.h index f2d16d6..182afa4 100644 --- a/inc/graph.h +++ b/inc/graph.h @@ -205,7 +205,7 @@ public: int getFarest (const Vector &origin, const float maxRange = 32.0); int getForAnalyzer (const Vector &origin, const float maxRange); int getNearest (const Vector &origin, const float range = kInfiniteDistance, int flags = -1); - int getNearestNoBuckets (const Vector &origin, float nearestDistanceSq = kInfiniteDistance, int flags = -1); + int getNearestNoBuckets (const Vector &origin, const float range = kInfiniteDistance, int flags = -1); int getEditorNearest (const float maxRange = 50.0f); int clearConnections (int index); int getBspSize (); diff --git a/src/botlib.cpp b/src/botlib.cpp index e70e2a8..0f684e1 100644 --- a/src/botlib.cpp +++ b/src/botlib.cpp @@ -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 } diff --git a/src/vision.cpp b/src/vision.cpp index b30d68b..3b47da7 100644 --- a/src/vision.cpp +++ b/src/vision.cpp @@ -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; }