From 07ec86c4af16336125d44bc1b96971b5250c9f93 Mon Sep 17 00:00:00 2001 From: terminx Date: Sun, 29 Apr 2018 17:20:01 +0000 Subject: [PATCH] Mapster32: second attempt at preventing extra wall points from being inserted on some walls with the batch point insert tool git-svn-id: https://svn.eduke32.com/eduke32@6863 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/build/src/build.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/source/build/src/build.cpp b/source/build/src/build.cpp index 7931ae99f..e2e6ee44b 100644 --- a/source/build/src/build.cpp +++ b/source/build/src/build.cpp @@ -7606,22 +7606,22 @@ end_space_handling: } newnumwalls = -1; - char touchedwall[(MAXWALLS+7)>>3]; for (i=0; i>3]; Bmemset(touchedwall, 0, sizeof(touchedwall)); for (j=numwalls-1; j>=0; j--) /* j may be modified in loop */ { - vec2_t pint; - int32_t inspts; - YAX_SKIPWALL(j); - if (wall[j].nextwall >= 0 && (touchedwall[wall[j].nextwall>>3] & pow2char[wall[j].nextwall&7])) + if ((touchedwall[j >> 3] & pow2char[j & 7]) + || (wall[j].nextwall >= 0 && (touchedwall[wall[j].nextwall >> 3] & pow2char[wall[j].nextwall & 7]))) continue; + vec2_t pint; + if (!lineintersect2v((vec2_t *)&wall[j], (vec2_t *)&POINT2(j), &point[i], &point[i+1], &pint)) continue; @@ -7631,7 +7631,10 @@ end_space_handling: touchedwall[j>>3] |= (1<<(j&7)); - inspts = M32_InsertPoint(j, pint.x, pint.y, -1, &j); /* maybe modify j */ + if (wall[j].nextwall != -1) + touchedwall[wall[j].nextwall>>3] |= (1<<(wall[j].nextwall&7)); + + int32_t inspts = M32_InsertPoint(j, pint.x, pint.y, -1, &j); /* maybe modify j */ if (inspts==0) {