Why does the two bots just get stuck INTO each other sometimes ?
I know the problem may be because the msec calculation, but Tobias' method is l33t enough I think... (my computer is an old Celeron 466MHz with 64MB RAM, but Tobias' method should work well)
And also I'm running the bot in Metamod so the GetBlendingInterface shouldn't be a problem
Code:
static float msecdel = 0;
static float msecnum = 0;
if (msecdel + msecnum / 1000 < gpGlobals->time - 0.5 ||
msecdel > gpGlobals->time)
{
msecdel = gpGlobals->time - 0.05;
msecnum = 0;
}
g_iMsecval = (gpGlobals->time - msecdel) * 1000 - msecnum; // optimal msec value since start of 1 sec period
msecnum = (gpGlobals->time - msecdel) * 1000; // value we have to add to reach optimum
// do we have to start a new 1 sec period?
if (msecnum > 1000)
{
msecdel += msecnum / 1000;
msecnum = 0;
}
if (g_iMsecval < 5)
g_iMsecval = 5; // don't allow the msec delay to be too low
else if (g_iMsecval > 255)
g_iMsecval = 255; // don't allow it to last longer than 255 milliseconds either