From b4a8656910bc21f2f3a670cfeee0018171c37cf0 Mon Sep 17 00:00:00 2001 From: terminx Date: Mon, 23 Apr 2018 10:15:12 +0000 Subject: [PATCH] Fix Mapster32 bug where sometimes you'd get two points instead of one when pressing enter to insert points where the lines intersect with the wall drawing tool git-svn-id: https://svn.eduke32.com/eduke32@6857 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/build/src/build.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) 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)