Skip to content

Commit

Permalink
Update v2.2.1 (#9)
Browse files Browse the repository at this point in the history
* Update reference link

* Fix destroy method

* Update v2.2.1
  • Loading branch information
grayzcale authored Feb 28, 2022
1 parent 67bae48 commit 6b8ee98
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## v2.2.1 (2022-02-28)
* Fixed `Path:Destroy()`
* Properly handles the deletion of visual waypoints
* Automatically stops further execution when destroyed
* Updated reference link

## v2.2.0 (2022-01-29)
* Fixed bug with Path.WaypointReached
* Emerges if `Path:Run()` is binded to both `Path.WaypointReached` and `Path.Reached` for a Humanoid
Expand Down
7 changes: 5 additions & 2 deletions src/SimplePath.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-------------------------------------------------------------------
Created by: @V3N0M_Z
Reference: https://00xima.github.io/RBLX-SimplePath/
Reference: https://v3n0m-z.github.io/RBLX-SimplePath/
License: MIT
---------------------------------------------------------------------
Expand Down Expand Up @@ -128,6 +128,9 @@ local function invokeWaypointReached(self)
end

local function moveToFinished(self, reached)

--Stop execution if Path is destroyed
if not getmetatable(self) then return end

--Handle case for non-humanoids
if not self._humanoid then
Expand Down Expand Up @@ -238,7 +241,7 @@ function Path:Destroy()
event:Destroy()
end
self._events = nil
if rawget(self, "Visualize") then
if rawget(self, "_visualWaypoints") then
self._visualWaypoints = destroyVisualWaypoints(self._visualWaypoints)
end
self._path:Destroy()
Expand Down

0 comments on commit 6b8ee98

Please sign in to comment.