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 @@ -226,7 +226,7 @@ ActionResult< CNEOBot > CNEOBotRetreatFromGrenade::Update( CNEOBot *me, float in

if (!m_coverArea)
{
return SuspendFor(new CNEOBotRetreatToCover, "Reacting to contact instead");
return Done("Reacting to contact instead");
}

if ( me->GetLastKnownArea() != m_coverArea || !bIsExposed )
Expand Down
13 changes: 13 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 @@ -5,6 +5,7 @@
#include "neo_smokelineofsightblocker.h"
#include "bot/neo_bot.h"
#include "bot/behavior/neo_bot_grenade_dispatch.h"
#include "bot/behavior/neo_bot_retreat_from_grenade.h"
#include "bot/behavior/neo_bot_retreat_to_cover.h"
#include "bot/neo_bot_path_compute.h"

Expand Down Expand Up @@ -203,6 +204,18 @@ ActionResult< CNEOBot > CNEOBotRetreatToCover::OnStart( CNEOBot *me, Action< CNE
//---------------------------------------------------------------------------------------------
ActionResult< CNEOBot > CNEOBotRetreatToCover::Update( CNEOBot *me, float interval )
{
if ( m_grenadeCheckTimer.IsElapsed() )
{
m_grenadeCheckTimer.Start( 0.2f );

CBaseEntity *dangerousGrenade = CNEOBotRetreatFromGrenade::FindDangerousGrenade( me );
if ( dangerousGrenade )
{
// ChangeTo: Avoid behavior pingpong if grenade avoidance can't find cover
return ChangeTo( new CNEOBotRetreatFromGrenade( dangerousGrenade ), "Encountered grenade while retreating to cover!" );
}
}

const CKnownEntity *threat = me->GetVisionInterface()->GetPrimaryKnownThreat( true );

if (!threat)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class CNEOBotRetreatToCover : public Action< CNEOBot >
CountdownTimer m_repathTimer;

CNavArea *m_coverArea;
CountdownTimer m_grenadeCheckTimer;
CountdownTimer m_grenadeThrowCooldownTimer;
CountdownTimer m_waitInCoverTimer;

Expand Down
Loading