The distance if nothing was hit is simply the distance between the VECTOR* from and VECTOR* to .. isn't it?

Code:
result = c_trace(trace_from,trace_to,IGNORE_ME);
if(!result)
{
  distance = vec_dist(trace_from,trace_to);
}
else { distance = result; }