The target selection seems to be made in get_victim().
You could use TraceHull with an appropriate body to determine if the target is partly covered by something. But it may not have the effect that you want.
A simple distance check should also work. But I'm assuming get_victim() has something like this since no parameters are fed into it.