In bot.cpp in BotSpawnInit function:
PHP Code:
pBot->fTimePrevThink = gpGlobals->time;
pBot->fTimePrevThink2 = gpGlobals->time;
pBot->fTimeFrameInterval = 0.0;
pBot->i_msecval = 0; // KWo - 17.03.2007
pBot->f_msecvalrest = 0.0; // KWo - 17.03.2007
And the clue is somewhere at the end of the function BotThink in bot.cpp (almost at bottom of that file):
PHP Code:
// this is Leon Hartwig's method for computing the msec value
f_msecval = (gpGlobals->time - pBot->fTimePrevThink2) * 1000.0;
pBot->fTimePrevThink2 = gpGlobals->time;
i_msecvalrest = 0; // KWo - 17.03.2007
i_msecval = (int) (f_msecval); // KWo - 17.03.2007
if (i_msecval < 10) // KWo - 17.03.2007
{
f_msecval = f_msecval - (float)(i_msecval) + pBot->f_msecvalrest;
i_msecvalrest = (int)(f_msecval);
pBot->f_msecvalrest = f_msecval - (float)(i_msecvalrest);
}
i_msecval = i_msecval + i_msecvalrest;
if (i_msecval < 1)
i_msecval = 1; // don't allow the msec delay to be null
else if (i_msecval > 100)
i_msecval = 100; // don't allow it to last longer than 100 milliseconds either
g_engfuncs.pfnRunPlayerMove (pEdict, vecMoveAngles, pBot->f_move_speed, pBot->f_sidemove_speed, 0, pEdict->v.button, 0, (unsigned char) i_msecval); // KWo - 25.09.2006 - thanks to THE_STORM