From cbcb4a7ff04da24ca6291694c9c9e8b780715829 Mon Sep 17 00:00:00 2001 From: jeefo Date: Fri, 15 Mar 2024 21:23:17 +0300 Subject: [PATCH] fix: missing world time when surprising enemies (ref #534) --- src/combat.cpp | 1 + src/manager.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/combat.cpp b/src/combat.cpp index 8e0ef91..8acaf22 100644 --- a/src/combat.cpp +++ b/src/combat.cpp @@ -389,6 +389,7 @@ bool Bot::lookupEnemies () { else { m_enemySurpriseTime = m_actualReactionTime; } + m_enemySurpriseTime += game.time (); // zero out reaction time m_actualReactionTime = 0.0f; diff --git a/src/manager.cpp b/src/manager.cpp index 6eca50c..2fa2e99 100644 --- a/src/manager.cpp +++ b/src/manager.cpp @@ -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;