Hello,

you could do something like this:

 Code:
vec_diff(vec_to_target, you.x, my.x); // direction vector from my to you
vec_to_angle(ang_to_target, vec_to_target); // get angles of direction vector

if (ang(ang_to_target.pan - my.pan) < 0) {
   my.pan -= 4 * time_step;
} else {
   my.pan += 4 * time_step;
}


The stuff in theconditional statement - ang(ang_to_target.pan - my.pan) - is the vital part, that calculates the difference between the pan angles of the my entity and the direction vector.