caewok / fvtt-token-visibility

Advanced token visibility rules for Foundry VTT
MIT License
4 stars 8 forks source link

Error in this scene when clicking on any token which freezes the canvas #81

Open Zamrod opened 7 months ago

Zamrod commented 7 months ago

I get the following error when clicking on either of the two tokens in the attached scene. It causes the scene to appear frozen and nothing updates without a refresh after that,

bWrapper-wrapper.js:513 Uncaught TypeError: undefined. Cannot read properties of null (reading '_textureData')
[Detected 2 packages: tokenvisibility, lib-wrapper]
    at TilePixelCache.fromOverheadTileAlpha (PixelCache.js:1892:21)
    at Tile.evPixelCache (Tile.js:22:69)
    at AlternativeLOS.js:940:25
    at Set.filter (commons.js:3555:12)
    at PointsLOS._filterTilesByVisionPolygon (AlternativeLOS.js:932:18)
    at PointsLOS._filterSceneObjectsByVisionPolygon (AlternativeLOS.js:855:10)
    at PointsLOS._findBlockingObjects (AlternativeLOS.js:464:28)
    at get blockingObjects [as blockingObjects] (AlternativeLOS.js:310:52)
    at PointsLOS._hasTileCollision (AlternativeLOS.js:532:24)
    at PointsLOS._testPointToPoints (PointsLOS.js:182:17)
    at PointsLOS._testTargetPoints (PointsLOS.js:154:35)
    at PointsLOS._percentVisible (PointsLOS.js:81:40)
    at PointsLOS.percentVisible (AlternativeLOS.js:346:58)
    at PointsLOS.hasLOS (AlternativeLOS.js:332:33)
    at LOSCalculator.hasLOSTo (LOSCalculator.js:45:24)
    at DetectionModeBasicSight._testLOS (DetectionMode.js:74:20)
    at 🎁DetectionMode.prototype._testLOS#0 (libWrapper-wrapper.js:187:52)
    at DetectionModeBasicSight._testPoint (DetectionModeBasicSight.js:87:15)
    at 🎁DetectionModeBasicSight.prototype._testPoint#0 (libWrapper-wrapper.js:187:52)
    at foundry.js:49652:36
    at Array.some (<anonymous>)
    at DetectionModeBasicSight.testVisibility (foundry.js:49652:18)
    at 🎁call_wrapped [as call_wrapped] (libWrapper-wrapper.js:507:22)
    at DetectionModeBasicSight.testVisibility (DetectionMode.js:37:10)
    at 🎁DetectionMode.prototype.testVisibility#0 (libWrapper-wrapper.js:187:52)
    at CanvasVisibility.testVisibility (foundry.js:38552:39)
    at 🎁call_wrapped [as call_wrapped] (libWrapper-wrapper.js:507:22)
    at CanvasVisibility.testVisibility (CanvasVisibility.js:26:10)
    at 🎁CanvasVisibility.prototype.testVisibility#0 (libWrapper-wrapper.js:187:52)
    at get isVisible [as isVisible] (foundry.js:54639:38)
    at Token5e._refreshVisibility (foundry.js:55052:25)
    at CanvasVisibility.restrictVisibility (foundry.js:38476:9)
    at CanvasVisibility.refresh (foundry.js:38311:10)
    at PerceptionManager.applyRenderFlags (foundry.js:50398:58)
    at #applyRenderFlags (foundry.js:27811:44)
    at nn.emit (index.js:89:1)
    at Dt.update (index.js:89:1)
    at Dt._tick (index.js:89:1)

image image image image image image image fvtt-Scene-test-HjcMH9XiFbN6ApgL.json

Quasxen commented 5 months ago

I'm getting a similar error. Everything works perfectly if I turn off Alternative Token Visibility. I set everything to "Reset Using DnD5e"

image

Quasxen commented 5 months ago

Update: I found what is causing the errors. I found it odd that it was only occurring on some scenes, so I kept trying to see what the difference was: Overhead Tiles. If there is a single tile set as being overhead, you'll get the errors and lock-up. If you make all the tiles underfoot, the errors don't occur.

I hope this helps to track down the coding issue

Conradhowlf commented 4 months ago

Update: I found what is causing the errors. I found it odd that it was only occurring on some scenes, so I kept trying to see what the difference was: Overhead Tiles. If there is a single tile set as being overhead, you'll get the errors and lock-up. If you make all the tiles underfoot, the errors don't occur.

I hope this helps to track down the coding issue

Hey thanks man, I was gettinv crazy here trying to find out what was happening. Hopefully it will get fix somewhere down the line

Quasxen commented 4 months ago

Things seem to work fine in v0.6.2. So it was something that changed when going to v0.6.3. If there's anything else I can help with, let me know

Conradhowlf commented 4 months ago

Oh, maybe I can download the previous version then?

Quasxen commented 4 months ago

I would think you can. Once you do, make a backup copy of it. That way when you go to update all your modules you can revert this one back to the working version

Conradhowlf commented 4 months ago

Where could I find the older versions manifests tho? Is it somewhere around here?

Quasxen commented 4 months ago

On the Foundry site searching through the Systems and Modules, you can go to this module's page and select the revision you want

https://foundryvtt.com/packages/tokenvisibility