wsaunders1014 / ShowDragDistance

Shows distance you dragged the token, similar to pressing ctrl.
10 stars 13 forks source link

Stops calculating on switching scenes #54

Closed JohnSBarden closed 4 years ago

JohnSBarden commented 4 years ago

Module works fine on initial load, but as soon as I switch scenes, it stops calculating correctly. Worked on a previous version.

Gif of issue switchingscenes

Console shows the following error

Uncaught TypeError: Cannot read property 'costGrid' of undefined at Function.checkForTerrain (terrain-calculation.js:94) at player-data.js:82 at Array.map () at Boolean.handleMouseMove (player-data.js:82) at e.a.emit (index.js:181) at r.dispatchEvent (InteractionManager.js:1028) at r.processPointerMove (InteractionManager.js:1499) at pr.recursiveFindHit (TreeSearch.js:166) at pr.findHit (TreeSearch.js:191) at r.processInteractive (InteractionManager.js:1097)

Replicated in Firefox and Chrome.

Using FoundryVTT v0.6.6 system: PF2e v1.10.13.2079 Show Drag Distance v2.1.9

JohnSBarden commented 4 years ago

Sorry, this is an issue with Difficult Terrain/Terrain Layer, not Show Drag Distance.

wsaunders1014 commented 4 years ago

What is terrain-calculation.js? I see that in the callstack. I'm making some fixes to Terrain Layer and ShowDragDistance so they work together, but they shouldn't be live yet.

JohnSBarden commented 4 years ago

It was due to not having Terrain Layer installed/enabled, and it was attempting to calculate based on the Difficult Terrain without any placed/not having its dependency.