Use a linetrace and on hit, and for loop, draw a new linetrace starting from the hit point and ending at old intended end point. Break loop on no hit.
Use a linetrace and on hit, and for loop, draw a new linetrace starting from the hit point and ending at old intended end point. Break loop on no hit.