modified CastRay function to hail through walls