diff --git a/source/build/src/build.cpp b/source/build/src/build.cpp index d65e10b42..6fdfba56c 100644 --- a/source/build/src/build.cpp +++ b/source/build/src/build.cpp @@ -7606,9 +7606,12 @@ end_space_handling: } newnumwalls = -1; + char touchedwall[(MAXWALLS+7)>>3]; for (i=0; i=0; j--) /* j may be modified in loop */ { vec2_t pint; @@ -7616,6 +7619,9 @@ end_space_handling: YAX_SKIPWALL(j); + if (wall[j].nextwall >= 0 && (touchedwall[wall[j].nextwall>>3] & pow2char[wall[j].nextwall&7])) + continue; + if (!lineintersect2v((vec2_t *)&wall[j], (vec2_t *)&POINT2(j), &point[i], &point[i+1], &pint)) continue; @@ -7623,6 +7629,8 @@ end_space_handling: if (vec2eq(&pint, (vec2_t *)&wall[j]) || vec2eq(&pint, (vec2_t *)&POINT2(j))) continue; + touchedwall[j>>3] |= (1<<(j&7)); + inspts = M32_InsertPoint(j, pint.x, pint.y, -1, &j); /* maybe modify j */ if (inspts==0)