From a5f679fd5d4b1cd3aac9ddf866ca17037832833f Mon Sep 17 00:00:00 2001 From: Weston Vincze Date: Thu, 20 Jun 2024 16:56:46 -0400 Subject: [PATCH] Fix bug causing smoothenPath to fail when the path is blocked --- src/core/Util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/Util.js b/src/core/Util.js index 3e35956b..f687156d 100644 --- a/src/core/Util.js +++ b/src/core/Util.js @@ -164,7 +164,7 @@ function smoothenPath(grid, path) { } } if (blocked) { - lastValidCoord = path[i - 1]; + var lastValidCoord = path[i - 1]; newPath.push(lastValidCoord); sx = lastValidCoord[0]; sy = lastValidCoord[1];