In the entity performing the scanning, perhaps you can simply do one check for distance (using vec_dist) based on the modified 'you' pointer given that c_scan result is greater than zero:
Code:
result = c_scan(...);
if(result>0 && you != NULL){
var distance = vec_dist(my.x, you.x);
if(distance > 100) { ... } // do something if further than a distance of 100
}