- for k,v in pairs(path) do
- if #cache.a == 2 then
- if #cache.b == 2 then
- if doLinesIntersect(x1,y1, x2,y2, cache.a[1],cache.a[2], cache.b[1],cache.b[2]) then
- return true
- end
- end
- cache.b = cache.a
- cache.a = {}
+ while node and node.prev do
+ local v3 = node.vector
+ local v4 = node.prev.vector
+ if doLinesIntersect(v1.x,v1.y, v2.x,v2.y, v3.x,v3.y, v4.x,v4.y) then
+ return true