aim: use aiming node instead of nearest to predict enemy position (suggested by @commandcobra7)

This commit is contained in:
jeefo 2022-11-11 21:23:15 +03:00
commit 1debbe3654
No known key found for this signature in database
GPG key ID: D85B0637366787C3

View file

@ -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;