Eranziel / foundryvtt-lancer

A Foundry VTT game system for LANCER RPG.
GNU General Public License v3.0
106 stars 64 forks source link

[BUG] Using faction logos for actor icon breaks the scene #448

Open nonamethanks opened 2 years ago

nonamethanks commented 2 years ago

Opening this issue for my GM, who's running Foundry, since he doesn't have a Github account.

Describe the bug Using a faction logo on an NPC and dragging it to a scene completely breaks the scene.

To Reproduce Steps to reproduce the behavior:

  1. Create a new NPC actor with faction-logos/union.svg or another faction logo as icon
  2. Drag it onto a scene
  3. The scene completely breaks, shows a single color, and everything is unresponsive

This only seems to happen with the files under faction-logos, not the other icons.

It should also be noted that once it's broken, it's not possible to interact with anything in the map (or other maps), almost everything but the chat is broken. It's almost like the javascript responsible for rendering the scene is completely broken. Doing an F5 refresh will make it work again until you visit the broken scene again, at which point it'll break again. You basically have to delete the affected scene to fix it.

In the developer tools, the following errors are shown:

core.min.js:8 Uncaught DOMException: Failed to execute 'texImage2D' on 'WebGL2RenderingContext': The image element contains cross-origin data, and may not be loaded.
    at r.upload (http://localhost:30000/scripts/pixi.min.js:8:127584)
    at r.upload (http://localhost:30000/scripts/pixi.min.js:8:131278)
    at e.updateTexture (http://localhost:30000/scripts/pixi.min.js:8:231932)
    at e.bind (http://localhost:30000/scripts/pixi.min.js:8:230260)
    at e.r.bindAndClearTexArray (http://localhost:30000/scripts/pixi.min.js:8:248646)
    at e.r.drawBatches (http://localhost:30000/scripts/pixi.min.js:8:249492)
    at e.r.flush (http://localhost:30000/scripts/pixi.min.js:8:249881)
    at e.r.stop (http://localhost:30000/scripts/pixi.min.js:8:250247)
    at t.setObjectRenderer (http://localhost:30000/scripts/pixi.min.js:8:164426)
    at t.flush (http://localhost:30000/scripts/pixi.min.js:8:164521)

Regenerating the thumbnail image for an affected scene shows:

core.min.js:8 Uncaught TypeError: Cannot read properties of null (reading '_batchEnabled')
    at e.r.buildTexturesAndDrawCalls (core.min.js:8)
    at e.r.flush (core.min.js:8)
    at e.r.stop (core.min.js:8)
    at t.setObjectRenderer (core.min.js:8)
    at t.flush (core.min.js:8)
    at SmoothGraphics._render (SmoothGraphics.ts:596)
    at SmoothGraphics.e.render (display.min.js:8)
    at e.render (display.min.js:8)
    at r.render (core.min.js:8)
    at t.render (app.min.js:8)

Expected behavior It shouldn't break.

Screenshots image

Platform (please complete the following information):

Discord contact info NCMagic#1578

Eranziel commented 1 year ago

Blocked by core issue: https://github.com/foundryvtt/foundryvtt/issues/6567

Eranziel commented 1 year ago

Marked wontfix but leaving open, in case/until the core issue is fixed.

BoltsJ commented 7 months ago

I don't know if our svgs got changed or if a PIXI.js update fixed this in foundry, but this doesn't seem to affect 2.0-rc.