diff --git a/src/game/server/neo/bot/behavior/neo_bot_retreat_from_grenade.cpp b/src/game/server/neo/bot/behavior/neo_bot_retreat_from_grenade.cpp index a9b2d14b1..68ba8bb7e 100644 --- a/src/game/server/neo/bot/behavior/neo_bot_retreat_from_grenade.cpp +++ b/src/game/server/neo/bot/behavior/neo_bot_retreat_from_grenade.cpp @@ -221,7 +221,15 @@ ActionResult< CNEOBot > CNEOBotRetreatFromGrenade::Update( CNEOBot *me, float in // track projectile and relation to escape destination every update if ( !m_coverArea || ( grenadeArea && grenadeArea->IsPotentiallyVisible( m_coverArea ) ) ) { + CNavArea *pPrevCoverArea = m_coverArea; m_coverArea = FindCoverArea( me ); + + // cover destination changed, stop following the path to the old spot + if ( m_coverArea != pPrevCoverArea ) + { + m_path.Invalidate(); + m_repathTimer.Invalidate(); + } } if (!m_coverArea) diff --git a/src/game/server/neo/bot/behavior/neo_bot_retreat_to_cover.cpp b/src/game/server/neo/bot/behavior/neo_bot_retreat_to_cover.cpp index 0557005cd..532e8652e 100644 --- a/src/game/server/neo/bot/behavior/neo_bot_retreat_to_cover.cpp +++ b/src/game/server/neo/bot/behavior/neo_bot_retreat_to_cover.cpp @@ -273,12 +273,19 @@ ActionResult< CNEOBot > CNEOBotRetreatToCover::Update( CNEOBot *me, float interv if ( threat ) { // threats are still visible - find new cover + CNavArea *pPrevCoverArea = m_coverArea; m_coverArea = FindCoverArea( me ); if ( m_coverArea == NULL ) { return Done( "My cover is exposed, and there is no other cover available!" ); } + + // cover destination changed, stop following the path to the old spot + if ( m_coverArea != pPrevCoverArea ) + { + m_path.Invalidate(); + } } else {