kckaiwei / TurnMarker-alt

Turn Marker is a module for Foundry VTT that adds an image under a token who is currently active in the combat tracker.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Cannot read property 'token' of undefined" when using an ability from a character that is not in the encounter tracker

Almarane opened this issue · comments

I use the Pathfinder 1 system.

Steps to reproduce :

  • Create a monster with any attack
  • Put the monster on the scene
  • Double-click on the monster's token to open its sheet
  • Use one of its attacks
    OR
  • Create a monster with any attack
  • Put the monster on the scene
  • Right click on the monster's token
  • Use one of its attacks from its quickbar under the token

Do NOT add the monster to the encounter tracker.

=> On the console, this error is displayed :

Uncaught (in promise) TypeError: Cannot read property 'token' of undefined
    at turnmarker.js:56
    at Function._call (foundry.js:2496)
    at Function.call (foundry.js:2481)
    at foundry.js:29991
    at Array.reduce (<anonymous>)
    at Scene.updateEmbeddedEntity (foundry.js:29978)
    at Token.update (foundry.js:11475)
    at ActorPF.updateEmbeddedEntity (foundry.js:31318)
    at ActorPF.PatchCore.ActorTokenHelpers.updateEmbeddedEntity (patch-core.js:199)
    at ItemPF.update (foundry.js:32513)

This error will also break the attack's calculation if you use the dialogue that appears when you use the attack to change some values.

Expected behaviour : I should be able to use a monster's attack even if it is not in the encounter tracker without breaking my roll's calculation