fix: bots do not look at the wall while camping. (solves #303)

This commit is contained in:
commandcobra7 2022-09-13 10:57:59 +03:00 committed by GitHub
commit 07a8a5c81e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3687,7 +3687,16 @@ void Bot::camp_ () {
}
}
else {
m_camp = graph[findCampingDirection ()].origin;
if (!game.isNullEntity (m_lastEnemy)) {
auto lastEnemyNearestIndex = graph.getNearest (m_lastEnemy->v.origin);
if (!util.isAlive (m_lastEnemy) && rg.get (1, 3) == 1 && graph.isVisible (m_currentNodeIndex, lastEnemyNearestIndex)) {
m_camp = graph[lastEnemyNearestIndex].origin;
}
}
else {
m_camp = graph[findCampingDirection ()].origin;
}
}
}
// press remembered crouch button