This comment says "Look at the avatar whose eyes are closest to the ray", however this is not what the code does.  What it actually does if find the FIRST avatar that is within the minimum angle and then returns.