nav: restore fix fall timer removed in last major pr
This commit is contained in:
parent
34630a4103
commit
6da92fe0f2
4 changed files with 6 additions and 2 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue