qiao / PathFinding.js

A comprehensive path-finding library for grid based games
http://qiao.github.io/PathFinding.js/visual/
8.4k stars 1.31k forks source link

lastValidCoord is undefined #149

Open dispossible opened 7 years ago

dispossible commented 7 years ago

In Util.js at line 167 in the smoothenPath function, lastValidCoord is undefined. Which if running the script standalone wouldn't be an issue as js will add the variable to the window scope, however it causes my build to error when used with the webpack and babel preprocessors.

I believe the fix for this is that variable should to be defined on line 145 along with the other scoped variables.

rejhgadellaa commented 3 years ago

Just ran into the same problem when packaging Pathfinding using Rollup. The problem is that lastValidCoord is not 'strict-mode' safe.

JanVeb commented 1 year ago

lastValidCoord is not defined

Whats up with this? Reading here it seems this issue was fixed? But it is still happening to me when trying to smoothen the path?

var newPath = PF.Util.compressPath(path);works though, is there big difrence betwen compresed and smoothen path?

rejhgadellaa commented 1 year ago

The pull request is still open, so this repo doesn't contain the fix yet. I doubt it ever will 😢

You can use my fork where I did merge the fix into master: https://github.com/rejhgadellaa/PathFinding.js/tree/master

JanVeb commented 1 year ago

Thanks, will check it out