Calculate an XYZ aim vector from the player through the XY aim point. Also calc XYZ vectors to nearby enemies. If the angle between any enemy vector and the aim vector is less that 5 degrees, make the enemy vector your aim vector. Cross products make the calcs faster.