@quenty/pathfindingutils 5.1.0 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [5.2.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/pathfindingutils@5.1.0...@quenty/pathfindingutils@5.2.0) (2022-07-31)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * Wrap promiseComputeAsync with pcall, as path finding can fail on long path call requests ([ca4faf5](https://github.com/Quenty/NevermoreEngine/commit/ca4faf595aed12b8de59eb1400e794b1db68d1d6))
12
+
13
+
14
+
15
+
16
+
6
17
  # [5.1.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/pathfindingutils@5.0.0...@quenty/pathfindingutils@5.1.0) (2022-06-21)
7
18
 
8
19
  **Note:** Version bump only for package @quenty/pathfindingutils
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/pathfindingutils",
3
- "version": "5.1.0",
3
+ "version": "5.2.0",
4
4
  "description": "Utilities involving pathfinding in Roblox",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -28,11 +28,11 @@
28
28
  "dependencies": {
29
29
  "@quenty/draw": "^4.1.0",
30
30
  "@quenty/loader": "^5.0.0",
31
- "@quenty/maid": "^2.3.0",
32
- "@quenty/promise": "^5.0.0"
31
+ "@quenty/maid": "^2.4.0",
32
+ "@quenty/promise": "^5.1.0"
33
33
  },
34
34
  "publishConfig": {
35
35
  "access": "public"
36
36
  },
37
- "gitHead": "c8732cc5dea767b3ff362db43137e2a16da7bc0d"
37
+ "gitHead": "e31b3a35aa475bb5699a24898a8639e107165b36"
38
38
  }
@@ -24,9 +24,15 @@ function PathfindingUtils.promiseComputeAsync(path, start, finish)
24
24
  assert(start, "Bad start")
25
25
  assert(finish, "Bad finish")
26
26
 
27
- return Promise.spawn(function(resolve, _)
28
- path:ComputeAsync(start, finish)
29
- resolve(path)
27
+ return Promise.spawn(function(resolve, reject)
28
+ local ok, err = pcall(function()
29
+ path:ComputeAsync(start, finish)
30
+ end)
31
+ if not ok then
32
+ reject(err or "Failed to compute path")
33
+ return
34
+ end
35
+ return resolve(path)
30
36
  end)
31
37
  end
32
38