View Single Post
Re: Angle offset bug
Old
  (#9)
Rifleman
This user broke our rules and has been BANNED
 
Status: Offline
Posts: 128
Join Date: Sep 2004
Location: Mars
Default Re: Angle offset bug - 06-12-2004

finally I figured it out , it is caused by the function BotFixIdealYaw()

The HPB_Bot template one is :

Code:
void BotFixIdealYaw(edict_t *pEdict)
{
   // check for wrap around of angle...
   if (pEdict->v.ideal_yaw >= 180)
	  pEdict->v.ideal_yaw -= 360 * ((int) (pEdict->v.ideal_yaw / 360) + 1);
   if (pEdict->v.ideal_yaw < -180)
	  pEdict->v.ideal_yaw += 360 * ((int) (-pEdict->v.ideal_yaw / 360) + 1);
}
It should rather be :

Code:
void BotFixIdealYaw(edict_t *pEdict)
{
   // check for wrap around of angle...
   if (pEdict->v.ideal_yaw > 180)
	  pEdict->v.ideal_yaw -= 360;
   if (pEdict->v.ideal_yaw < -180)
	  pEdict->v.ideal_yaw += 360;
}
Dont know wherever its the solution , havent test it out yet , but I think that is the solution since no other code are related to aiming and angle
  
Reply With Quote