This should rather be
Code:
+// If the fps is very low (e.g. when I'm running RealBot WIP and
+// bot with this code at the same time on my slow computer), the msec
+// value will be too large and the angle may exceed the deviation value. So
+// I've added a check here to prevent bots aiming from being messed up.
+// This seems to be "patching" but it works, also I have no clue about
+// the theory of the aiming algorithm :(
+ if (fabs(v_deviation.x - pev->pitch_speed) > 0)
+ pev->pitch_speed = v_deviation.x;
+
+ if (fabs(v_deviation.y - pev->yaw_speed) > 0)
+ pev->yaw_speed = v_deviation.y;
then, else you don't take care of the respective signs of v_deviation and aim speed, which can leads to a lot of problems in the aiming (like the bot able to get an instant headshot on new targets).
The drawback of this clamping is that it doesn't allow the bot's crosshair movement to get past the target point and then come back smoothly. I had it in in the first place, then I removed it, but I think I'm gonna put it back again because as you say it fixes the problem with the aim being messy at low FPS. Thanks for the reminder.