View Single Post
Re: JoeBot/RACC aiming
Old
  (#5)
Whistler
Summoner
 
Whistler's Avatar
 
Status: Offline
Posts: 1,499
Join Date: Feb 2004
Location: Mist Village
Default Re: JoeBot/RACC aiming - 02-08-2004

Code:
+      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;
...if you are doing this then bot will actually do inhuman turns all the time since as long as v_deviation.x isn't equal to pev->pitch_speed, fabs(v_deviation.x - pev->pitch_speed) will be >0.

Thanks to pointing this out anyway, now I have changed it to this one:
Code:
+      if (fabs(pev->pitch_speed) > fabs(v_deviation.x) && pev->pitch_speed * v_deviation.x > 0) 
+         pev->pitch_speed = v_deviation.x;
  
Reply With Quote