Fix crouch bot

This commit is contained in:
s1lentq 2024-06-09 15:46:50 +07:00
parent ad1c58cef5
commit a94c7bd728

View File

@ -261,6 +261,20 @@ void CBot::ExecuteCommand()
// Adjust msec to command time interval // Adjust msec to command time interval
adjustedMSec = ThrottledMsec(); 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 // Run mimic command
usercmd_t botCmd; usercmd_t botCmd;
if (!RunMimicCommand(botCmd)) if (!RunMimicCommand(botCmd))
@ -280,20 +294,6 @@ void CBot::ExecuteCommand()
// save the command time // save the command time
m_flPreviousCommandTime = gpGlobals->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 // Run the command
PLAYER_RUN_MOVE(edict(), botCmd.viewangles, botCmd.forwardmove, botCmd.sidemove, botCmd.upmove, botCmd.buttons, 0, adjustedMSec); PLAYER_RUN_MOVE(edict(), botCmd.viewangles, botCmd.forwardmove, botCmd.sidemove, botCmd.upmove, botCmd.buttons, 0, adjustedMSec);
} }