Skip to content

Commit

Permalink
Fix crouch bot
Browse files Browse the repository at this point in the history
  • Loading branch information
s1lentq committed Jun 9, 2024
1 parent ad1c58c commit a94c7bd
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions regamedll/game_shared/bot/bot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,20 @@ void CBot::ExecuteCommand()
// Adjust msec to command time interval
adjustedMSec = ThrottledMsec();

if (IsCrouching())
{
m_buttonFlags |= IN_DUCK;
}

#ifdef REGAMEDLL_FIXES
// don't move if frozen state present
if (pev->flags & FL_FROZEN)
{
adjustedMSec = 0;
ResetCommand();
}
#endif

// Run mimic command
usercmd_t botCmd;
if (!RunMimicCommand(botCmd))
Expand All @@ -280,20 +294,6 @@ void CBot::ExecuteCommand()
// save the command time
m_flPreviousCommandTime = gpGlobals->time;

if (IsCrouching())
{
m_buttonFlags |= IN_DUCK;
}

#ifdef REGAMEDLL_FIXES
// don't move if frozen state present
if (pev->flags & FL_FROZEN)
{
adjustedMSec = 0;
ResetCommand();
}
#endif

// Run the command
PLAYER_RUN_MOVE(edict(), botCmd.viewangles, botCmd.forwardmove, botCmd.sidemove, botCmd.upmove, botCmd.buttons, 0, adjustedMSec);
}
Expand Down

0 comments on commit a94c7bd

Please sign in to comment.