grandseiken / foundryvtt-multilevel-tokens

Multilevel tokens for Foundry VTT
MIT License
42 stars 20 forks source link

[Bug] Setting up teleport regions breaks foundry drawing tools #138

Open pbtura opened 1 year ago

pbtura commented 1 year ago

Setting up a drawn area to be a teleport zone causes the following error:

Uncaught (in promise) TypeError: this._original.texture?.clone is not a function
    at Drawing._draw (foundry.js:42052)
    at Drawing.draw (foundry.js:25199)
    at Drawing._onUpdate (foundry.js:42355)
    at DrawingDocument._onUpdate (foundry.js:12367)
    at ClientDatabaseBackend.callback (foundry.js:12823)
    at foundry.js:12804
    at Array.map (<anonymous>)
    at ClientDatabaseBackend._handleUpdateEmbeddedDocuments (foundry.js:12804)
    at ClientDatabaseBackend._updateEmbeddedDocuments (foundry.js:12672)
    at async Function.updateDocuments (commons.js:6153)

Attempting to interact with the drawing will cause additional errors to be thrown. The only way to restore functionality is to restart foundry.

Steps to reproduce:

  1. Create a new scene.
  2. Create a journal entry to act as the trigger.
  3. Use the drawing tools to create a rectangle.
  4. Open the edit dialog for the drawn area and select the 'multilevel' tab.
  5. Check the boxes for 'in' and 'out' under the 'teleports' section.
  6. Set the teleport identifier to the name of the journal entry.
  7. Select 'update drawing'.

Result: An error will be thrown and any further attempts to interact with the drawing will fail.

The problem seems to be related to the journal entry. If I place down the drawing areas and the journal notes on the map BEFORE configuring the drawing areas then no errors are thrown. If anything is done out of order however, it breaks the drawing tools.

Environment Details: