Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 7 additions & 0 deletions src/game/server/neo/bot/behavior/neo_bot_retreat_to_cover.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down