Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Cannot set properties of undefined (setting 'renderable') #253

Open
Kayne opened this issue Jul 19, 2023 · 1 comment
Open

[BUG] Cannot set properties of undefined (setting 'renderable') #253

Kayne opened this issue Jul 19, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@Kayne
Copy link

Kayne commented Jul 19, 2023

Module Version: 0.6.3.1

Before open any issue

I wanted to enable debugging but no such option is available for Token Magic FX module.

Describe the bug
When using Animate Dead spell "macro magic" from module Automated Animations, after choosing creature, the gray token appears but cannot be moved and all map canvas is freezed.

The error is raised from Token Magic FX module:

Uncaught TypeError: undefined. Cannot set properties of undefined (setting 'renderable')
[Detected 1 package: tokenmagic]
    at e.<anonymous> (settings.js:616:27)
    at a.emit (index.js:202:33)
    at r.dispatchEvent (interaction.min.mjs:8:12235)
    at r.processPointerMove (interaction.min.mjs:8:17255)
    at t.recursiveFindHit (interaction.min.mjs:8:4098)
    at t.findHit (interaction.min.mjs:8:4157)
    at r.processInteractive (interaction.min.mjs:8:12841)
    at r.onPointerMove (interaction.min.mjs:8:16687)

The original bug report from A-A module: https://github.com/otigon/automated-jb2a-animations/issues/666

To Reproduce
Steps to reproduce the behavior:

  1. Use Animate Dead spell
  2. Choose Zombie Shambler for instance, but breaks on every creature
  3. Freeze!
  4. See error in console

Expected behavior
No error, token should be placeable.

Browser:
Browser & version doesn't matter, same behaviour on all

Foundry Version:
10.291

Game System:
PF2e 4.12.9

Additional context
Sequencer Version: 3.1.2
Automated Animations version 4.2.62
Hosting Location: nodejs on server

Active modules:
Advanced Macros v;
Autocomplete Whisper v;
Automated Animations v;
Award XP v;
Cautious Gamemaster's Pack v;
Chat Images v;
Combat Enhancements v;
Dice So Nice! v;
Dice Tray v;
Drag Ruler v;
Enhanced Terrain Layer v;
Escape Window v;
Foundry VTT Anniversary Dice Set by The Rollsmith v;
Health Estimate v;
Image Hover v;
Initiative Double Click v;
Jam and Jax's NPC Ancestry Abilities v;
Jam and Jax's NPC Index: Specialists v;
Jam and Jax's NPC Index: Spellcaster v;
Jam and Jax's NPC Index: Warriors v;
JB2A - Patreon Complete Collection v;
libWrapper v.0;
LiveKit AVClient v;
Pathfinder 2e: Abomination Vaults v;
Pathfinder Beginner Box v;
Pathfinder Token Pack: Bestiaries v;
Pathmuncher: Pathbuilder character importer for PF2e v;
Perfect Vision v;
PF2e Animations v;
PF2e Companion Compendia v;
PF2e Dorako UI v;
PF2e Drag Ruler Integration v;
PF2E Exploration Effects v;
PF2e Giveth v;
pF2E Keybind Menagerie v;
Pf2E Modifiers Matter v;
PF2e Staves v;
PF2e Target Damage v;
PF2e Workbench v;
Polyglot v;
routinglib v;
Safety Tools v;
Sequencer v;
socketlib v;
Tidy UI - Game Settings v;
Token Action HUD Classic v;
Token Info Icons v;
Tokenizer v;
Token Magic FX v;
Token Mold v;
Warp Gate v;

@Kayne Kayne added the bug Something isn't working label Jul 19, 2023
@Kayne Kayne changed the title [BUG] [BUG] Cannot set properties of undefined (setting 'renderable') Jul 19, 2023
@Kayne
Copy link
Author

Kayne commented Jul 30, 2023

Source:

    Hooks.on("canvasReady", () => {
      canvas.stage.on("mousemove", event => {
        const {x: mx, y: my} = event.data.getLocalPosition(canvas.templates);
        for ( const template of canvas.templates.placeables ) {
          const hl = canvas.grid.getHighlightLayer(`MeasuredTemplate.${template.id}`);
          const opacity = template.document.getFlag("tokenmagic", "templateData")?.opacity ?? 1;
          if ( template.texture && template.texture !== "" ) {
            const {x: cx, y: cy} = template.center;
            const mouseover = template.shape.contains(mx - cx, my - cy);
            hl.renderable = mouseover;
            template.template.alpha = (mouseover ? 0.5 : 1.0) * opacity;
          }
          else {
            hl.renderable = true;
            template.template.alpha = opacity;
          }
        }
      });
    });
  }

and line:

            hl.renderable = true;

fails with Cannot set properties of undefined (setting 'renderable')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant