nav: restore fix fall timer removed in last major pr

This commit is contained in:
jeefo 2025-08-09 20:20:43 +03:00
commit 6da92fe0f2
No known key found for this signature in database
GPG key ID: D696786B81B667C8
4 changed files with 6 additions and 2 deletions

View file

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

View file

@ -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) {

View file

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

View file

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