From cb115b18815b8a4a31413da5608d14ab3039733f Mon Sep 17 00:00:00 2001 From: jeefo Date: Wed, 12 Apr 2023 22:50:26 +0300 Subject: [PATCH] nav: reduce a little nav reach time timer nav: switch back to main weapon only if on the floor --- src/botlib.cpp | 2 +- src/navigate.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/botlib.cpp b/src/botlib.cpp index a6e58df..bc0cf13 100644 --- a/src/botlib.cpp +++ b/src/botlib.cpp @@ -1599,7 +1599,7 @@ void Bot::overrideConditions () { } // special handling for reloading - if (getCurrentTaskId () == Task::Normal && m_reloadState != Reload::None && m_isReloading && !isDucking () && !isInNarrowPlace ()) { + if (!bots.isRoundOver () && getCurrentTaskId () == Task::Normal && m_reloadState != Reload::None && m_isReloading && !isDucking () && !isInNarrowPlace ()) { if (m_seeEnemyTime + 2.5f < game.time () && (m_states & (Sense::SuspectEnemy | Sense::HearingEnemy))) { m_moveSpeed = m_fearLevel > m_agressionLevel ? 0.0f : getShiftSpeed (); m_navTimeset = game.time (); diff --git a/src/navigate.cpp b/src/navigate.cpp index 7761a41..57ad40f 100644 --- a/src/navigate.cpp +++ b/src/navigate.cpp @@ -844,7 +844,7 @@ bool Bot::updateNavigation () { m_desiredVelocity = nullptr; } } - else if (!isKnifeMode () && m_switchedToKnifeDuringJump) { + else if (!isKnifeMode () && m_switchedToKnifeDuringJump && isOnFloor ()) { selectBestWeapon (); // if jump distance was big enough, cooldown a little @@ -1906,7 +1906,7 @@ bool Bot::findNextBestNode () { } float Bot::getEstimatedNodeReachTime () { - float estimatedTime = 6.0f; + float estimatedTime = 4.2f; // if just fired at enemy, increase reachability if (m_shootTime + 0.15f < game.time ()) { @@ -1926,7 +1926,7 @@ float Bot::getEstimatedNodeReachTime () { if (longTermReachability) { estimatedTime *= 2.0f; } - estimatedTime = cr::clamp (estimatedTime, 3.0f, longTermReachability ? 8.0f : 6.0f); + estimatedTime = cr::clamp (estimatedTime, 3.0f, longTermReachability ? 8.0f : 4.2f); } return estimatedTime + m_frameInterval; }