nav: improved ladder handling

fix: bots can stuck when destroying breakables
This commit is contained in:
jeefo 2024-03-29 16:46:32 +03:00
commit c5ed52eb09
No known key found for this signature in database
GPG key ID: 927BCA0779BEA8ED
5 changed files with 27 additions and 17 deletions

View file

@ -226,7 +226,7 @@ void Bot::setAimDirection () {
if (onLadder && m_pathWalk.hasNext ()) {
const auto &nextPath = graph[m_pathWalk.next ()];
if ((nextPath.flags & NodeFlag::Ladder) && m_destOrigin.distanceSq (pev->origin) < cr::sqrf (128.0f) && nextPath.origin.z > m_pathOrigin.z + 30.0f) {
if ((nextPath.flags & NodeFlag::Ladder) && m_destOrigin.distanceSq (pev->origin) < cr::sqrf (64.0f) && nextPath.origin.z > m_pathOrigin.z + 30.0f) {
m_lookAt = nextPath.origin;
}
}