looking like it isnt the best variant.. try this

Code:
void BotTurnTo(ENTITY* ent, VECTOR* targ_vec)
{
	var temp[3];
	
	vec_diff(temp,ent.x,targ_vec);
	vec_to_angle(targ_vec,temp);
	
	ent.pan -= sign(ang(180 + ent.pan - targ_vec.x)) * 5 * time_step;
}



1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro