Update generateCourse.lua

`if` changed in `segmentsIntersection()` to be tested