From 4173397ccec9b7e03e3a2ce1adb9edf9d35afc79 Mon Sep 17 00:00:00 2001 From: Ionut Hada Date: Fri, 16 Oct 2020 18:25:23 +0300 Subject: [PATCH] Added even more await calls in a desperate attempt to fix the ghost walls --- src/scripts/WallCutting.ts | 4 ++-- src/scripts/WallMerger.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/scripts/WallCutting.ts b/src/scripts/WallCutting.ts index 6006ef3..ed4257e 100644 --- a/src/scripts/WallCutting.ts +++ b/src/scripts/WallCutting.ts @@ -26,7 +26,7 @@ class WallCutting { const coords = wall.data.c; //first has 4 coords, the first 2 are the x and y of the first point while the last 2 are x, y of the center of the segment const first = [coords[0], coords[1], Math.floor((coords[0] + coords[2]) / 2), Math.floor((coords[1] + coords[3]) / 2)]; - //seconds has 4 coords the first 2 are the x and y of the center point of the segment and the last 2 are the x and y of the last point. + //second has 4 coords the first 2 are the x and y of the center point of the segment and the last 2 are the x and y of the last point. const second = [Math.floor((coords[0] + coords[2]) / 2), Math.floor((coords[1] + coords[3]) / 2), coords[2], coords[3]]; await this._createWallAtCoords(first, wall); @@ -36,7 +36,7 @@ class WallCutting { public async cutTheWall(wall: any) { await this._createNewWalls(wall); wall.release(); - wall.destroy(); + await wall.delete(); } } diff --git a/src/scripts/WallMerger.ts b/src/scripts/WallMerger.ts index 3870be5..c6ba57b 100644 --- a/src/scripts/WallMerger.ts +++ b/src/scripts/WallMerger.ts @@ -254,7 +254,7 @@ class WallMerger { }); mainWall.release(); - mainWall.delete(); + await mainWall.delete(); await this._createNewWallFromPointsArray(projectedPoints, mainWallData); } }