diff --git a/src/game/server/neo/bot/behavior/neo_bot_ctg_capture.cpp b/src/game/server/neo/bot/behavior/neo_bot_ctg_capture.cpp index 63e80b658..803967de8 100644 --- a/src/game/server/neo/bot/behavior/neo_bot_ctg_capture.cpp +++ b/src/game/server/neo/bot/behavior/neo_bot_ctg_capture.cpp @@ -16,9 +16,10 @@ CNEOBotCtgCapture::CNEOBotCtgCapture( CWeaponGhost *pObjective ) //--------------------------------------------------------------------------------------------- ActionResult CNEOBotCtgCapture::OnStart( CNEOBot *me, Action *priorAction ) { - m_captureAttemptTimer.Invalidate(); - m_repathTimer.Invalidate(); m_path.Invalidate(); + m_repathTimer.Invalidate(); + m_captureAttemptTimer.Start( 3.0f ); + m_previousKnownArea = me->GetLastKnownArea(); if ( !m_hObjective ) { @@ -52,6 +53,14 @@ ActionResult CNEOBotCtgCapture::Update( CNEOBot *me, float interval ) return Done( "Ghost was taken by someone else" ); } + // Add more capture time if we progressed to the next NavArea + CNavArea *pCurrentKnownArea = me->GetLastKnownArea(); + if ( pCurrentKnownArea != m_previousKnownArea ) + { + m_captureAttemptTimer.Start( 3.0f ); + m_previousKnownArea = pCurrentKnownArea; + } + if ( !m_repathTimer.HasStarted() || m_repathTimer.IsElapsed() ) { if ( !CNEOBotPathCompute( me, m_path, m_hObjective->GetAbsOrigin(), FASTEST_ROUTE ) ) @@ -64,12 +73,6 @@ ActionResult CNEOBotCtgCapture::Update( CNEOBot *me, float interval ) } m_path.Update( me ); - if ( !m_captureAttemptTimer.HasStarted() ) - { - // If this timer expires, give up - m_captureAttemptTimer.Start( 3.0f ); - } - CBaseCombatWeapon *pPrimary = me->Weapon_GetSlot( 0 ); if ( pPrimary ) { diff --git a/src/game/server/neo/bot/behavior/neo_bot_ctg_capture.h b/src/game/server/neo/bot/behavior/neo_bot_ctg_capture.h index 324450081..617ceb6a3 100644 --- a/src/game/server/neo/bot/behavior/neo_bot_ctg_capture.h +++ b/src/game/server/neo/bot/behavior/neo_bot_ctg_capture.h @@ -18,6 +18,7 @@ class CNEOBotCtgCapture : public Action private: CHandle m_hObjective; + CNavArea *m_previousKnownArea; CountdownTimer m_captureAttemptTimer; CountdownTimer m_repathTimer; PathFollower m_path;