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
9 changes: 9 additions & 0 deletions src/game/server/neo/bot/behavior/neo_bot_command_follow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ bool CNEOBotCommandFollow::FollowCommandChain(CNEOBot* me)
// Use sv_neo_bot_cmdr_stop_distance_sq for consistent bot collection range
// follow_stop_distance_sq would be confusing if player doesn't know about distance tuning
me->m_hLeadingPlayer = pCommander;
m_bCrouchWhenFollowingPing = false; // watch commander's stance
m_vGoalPos = CNEO_Player::VECTOR_INVALID_WAYPOINT;
pCommander->m_vLastPingByStar.GetForModify(me->GetStar()) = CNEO_Player::VECTOR_INVALID_WAYPOINT;
}
Expand All @@ -236,6 +237,7 @@ bool CNEOBotCommandFollow::FollowCommandChain(CNEOBot* me)
if (pCommander->m_vLastPingByStar.Get(me->GetStar()) != me->m_vLastPingByStar.Get(me->GetStar()))
{
me->m_hLeadingPlayer = nullptr; // Stop following and start travelling to ping
m_bCrouchWhenFollowingPing = pCommander->IsDucking();
m_vGoalPos = pCommander->m_vLastPingByStar.Get(me->GetStar());
me->m_vLastPingByStar.GetForModify(me->GetStar()) = pCommander->m_vLastPingByStar.Get(me->GetStar());

Expand All @@ -248,10 +250,16 @@ bool CNEOBotCommandFollow::FollowCommandChain(CNEOBot* me)
else
{
me->m_hLeadingPlayer = pCommander; // fallback to following commander
m_bCrouchWhenFollowingPing = false; // watch commander's stance
// continue with leader following logic below
}
}

if (m_bCrouchWhenFollowingPing)
{
me->PressCrouchButton(0.3f);
}

if (FanOutAndCover(me, m_vGoalPos))
{
// FanOutAndCover true: arrived at destination and settled, so don't recompute path
Expand All @@ -266,6 +274,7 @@ bool CNEOBotCommandFollow::FollowCommandChain(CNEOBot* me)
else
{
me->m_hLeadingPlayer = pCommander; // fallback to following commander
m_bCrouchWhenFollowingPing = false; // watch commander's stance
// continue with leader following logic below
}
}
Expand Down
1 change: 1 addition & 0 deletions src/game/server/neo/bot/behavior/neo_bot_command_follow.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class CNEOBotCommandFollow : public Action< CNEOBot >
CNEOBotGhostEquipmentHandler m_ghostEquipmentHandler;

IntervalTimer m_commanderLookingAtMeTimer;
bool m_bCrouchWhenFollowingPing = false;
bool m_bWasCommanderLookingAtMe = false;

EHANDLE m_hTargetEntity;
Expand Down
Loading