diff --git a/inc/yapb.h b/inc/yapb.h index 178e6d4..8079d3c 100644 --- a/inc/yapb.h +++ b/inc/yapb.h @@ -377,6 +377,7 @@ private: CountdownTimer m_forgetLastVictimTimer {}; // time to forget last victim position ? CountdownTimer m_approachingLadderTimer {}; // bot is approaching ladder CountdownTimer m_lostReachableNodeTimer {}; // bot's issuing next node, probably he's lost + CountdownTimer m_fixFallTimer {}; // timer we're fixed fall last time CountdownTimer m_repathTimer {}; // bots is going to repath his route private: diff --git a/src/manager.cpp b/src/manager.cpp index 335570f..e5cf4b5 100644 --- a/src/manager.cpp +++ b/src/manager.cpp @@ -1603,6 +1603,7 @@ void Bot::newRound () { m_approachingLadderTimer.invalidate (); m_forgetLastVictimTimer.invalidate (); m_lostReachableNodeTimer.invalidate (); + m_fixFallTimer.invalidate (); m_repathTimer.invalidate (); for (auto &timer : m_chatterTimes) { diff --git a/src/navigate.cpp b/src/navigate.cpp index cc459aa..46d7109 100644 --- a/src/navigate.cpp +++ b/src/navigate.cpp @@ -935,7 +935,7 @@ void Bot::checkFall () { } } - if (!m_checkFall || !isOnFloor ()) { + if (!m_checkFall || !isOnFloor () || !m_fixFallTimer.elapsed ()) { return; } m_checkFall = false; @@ -962,6 +962,8 @@ void Bot::checkFall () { if (fixFall) { m_currentNodeIndex = kInvalidNodeIndex; findValidNode (); + + m_fixFallTimer.start (1.0f); } } diff --git a/src/vision.cpp b/src/vision.cpp index 30c14fa..4f553ac 100644 --- a/src/vision.cpp +++ b/src/vision.cpp @@ -433,7 +433,7 @@ void Bot::setAimDirection () { } // don't switch view right away after loosing focus with current enemy - if (m_seeEnemyTime + 1.5f > game.time () + if ((m_shootTime + rg (1.0f, 1.5f) > game.time () || m_seeEnemyTime + 1.5f > game.time ()) && m_forgetLastVictimTimer.elapsed () && !m_lastEnemyOrigin.empty () && util.isAlive (m_lastEnemy)