fix: missing world time when surprising enemies (ref #534)

This commit is contained in:
jeefo 2024-03-15 21:23:17 +03:00
commit cbcb4a7ff0
No known key found for this signature in database
GPG key ID: 927BCA0779BEA8ED
2 changed files with 2 additions and 1 deletions

View file

@ -389,6 +389,7 @@ bool Bot::lookupEnemies () {
else {
m_enemySurpriseTime = m_actualReactionTime;
}
m_enemySurpriseTime += game.time ();
// zero out reaction time
m_actualReactionTime = 0.0f;

View file

@ -1354,7 +1354,7 @@ void BotManager::handleDeath (edict_t *killer, edict_t *victim) {
&& game.isNullEntity (notify->m_lastEnemy)
&& util.isVisible (killer->v.origin, notify->ent ())) {
// make bot look at last e nemy position
// make bot look at last enemy position
notify->m_actualReactionTime = 0.0f;
notify->m_seeEnemyTime = game.time ();
notify->m_enemy = killer;