Skip to content

Commit e69c385

Browse files
committed
1 parent 09fb6f1 commit e69c385

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/game/server/hl2mp/bot/hl2mp_bot_locomotion.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88

99
extern ConVar falldamage;
1010

11+
#ifdef BDSBASE
12+
ConVar hl2mp_bot_nav_crouch("hl2mp_bot_nav_crouch", "1", FCVAR_CHEAT);
13+
#endif
14+
1115
//-----------------------------------------------------------------------------------------
1216
void CHL2MPBotLocomotion::Update( void )
1317
{
@@ -23,6 +27,21 @@ void CHL2MPBotLocomotion::Update( void )
2327
if ( IsOnGround() )
2428
{
2529
me->ReleaseCrouchButton();
30+
31+
#ifdef BDSBASE
32+
if (hl2mp_bot_nav_crouch.GetBool())
33+
{
34+
const PathFollower* path = me->GetCurrentPath();
35+
if (path && path->GetCurrentGoal() && path->GetCurrentGoal()->area)
36+
{
37+
if (path->GetCurrentGoal()->area->GetAttributes() & NAV_MESH_CROUCH)
38+
{
39+
// moving through a crouch area
40+
me->PressCrouchButton(0.3f);
41+
}
42+
}
43+
}
44+
#endif
2645
}
2746
else
2847
{

0 commit comments

Comments
 (0)