View Single Post
Re: POD-bot back into shape.
Old
  (#329)
Whistler
Summoner
 
Whistler's Avatar
 
Status: Offline
Posts: 1,499
Join Date: Feb 2004
Location: Mist Village
Default Re: POD-bot back into shape. - 02-04-2004

Quote:
Originally Posted by Pierre-Marie Baty
HERE's the fix fix fix!
Code:
 void UTIL_ClampAngle (float *fAngle)
 {
    // Whistler, TEST your bugfixes before submitting them!!! :D
    if (*fAngle >= 180)
 	  *fAngle -= 360 * ((int) (*fAngle / 360) + 1); // and not 0.5
    if (*fAngle < -180)
 	  *fAngle += 360 * ((int) (-*fAngle / 360) + 1); // and not 0.5
Huh ? I'm using the 0.5 thing all the time in YaPB and it works all the time. Anyway the 0.5 is INSIDE the ().