diff --git a/src/game/server/neo/bot/behavior/neo_bot_command_follow.cpp b/src/game/server/neo/bot/behavior/neo_bot_command_follow.cpp index d4f433c2e..069608bcf 100644 --- a/src/game/server/neo/bot/behavior/neo_bot_command_follow.cpp +++ b/src/game/server/neo/bot/behavior/neo_bot_command_follow.cpp @@ -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; } @@ -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()); @@ -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 @@ -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 } } diff --git a/src/game/server/neo/bot/behavior/neo_bot_command_follow.h b/src/game/server/neo/bot/behavior/neo_bot_command_follow.h index fe2afab06..658ad49ab 100644 --- a/src/game/server/neo/bot/behavior/neo_bot_command_follow.h +++ b/src/game/server/neo/bot/behavior/neo_bot_command_follow.h @@ -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;