Hmmm, I only used ignore_me and ignore_passable in my function. Could adding use_box make a difference? Doesn't seem very likely, but that is different.
Ahh, I have a vec_sub to put the desired camera position temp_cdist.x behind the player for the trace sort of like this:
vec_set(temp, player.X);
vec_sub(temp, temp_cdist);
trace_mode = ignore_me + ignore_passable;
result = trace(player.X, temp);
(I changed it from the way I did it to make is more like your function, hope I didn't screw it up.)
The only other thing I see is when result1 is greater than zero, it looks like the cammera is moving away. Should it move closer? But that doesn't have anything to do with the trace function.