From 1debbe36549946f3e358f5e8024cad32cc3465a7 Mon Sep 17 00:00:00 2001 From: jeefo Date: Fri, 11 Nov 2022 21:23:15 +0300 Subject: [PATCH] aim: use aiming node instead of nearest to predict enemy position (suggested by @commandcobra7) --- src/botlib.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/botlib.cpp b/src/botlib.cpp index b94921c..945b6c9 100644 --- a/src/botlib.cpp +++ b/src/botlib.cpp @@ -3688,7 +3688,7 @@ void Bot::camp_ () { } else { if ((!game.isNullEntity (m_lastEnemy) && !m_lastEnemyOrigin.empty ()) || util.isAlive (m_lastEnemy)) { - auto lastEnemyNearestIndex = graph.getNearest (m_lastEnemy->v.origin); + auto lastEnemyNearestIndex = findAimingNode (m_lastEnemyOrigin); if (lastEnemyNearestIndex != kInvalidNodeIndex && graph.isVisible (m_currentNodeIndex, lastEnemyNearestIndex)) { m_camp = graph[lastEnemyNearestIndex].origin;