Larkinabout / fvtt-custom-dnd5e

11 stars 7 forks source link

Removal of Perception skill causes NPC sheets to not load #90

Open pwykersotz opened 2 weeks ago

pwykersotz commented 2 weeks ago

If the perception skill is removed using this addon, monsters sheets will fail to display using the default sheet. TidySheet and the Legacy Default sheet work fine. The issue seems to deal with passive perception. This should be reproduceable by simply unchecking perception from Configure Skills.

This error can be reproduced with only the Custom D&D 5e module enabled. PC's can be accessed with no problem, but any NPC, whether created before or after the change is impacted.

foundry.js:655 Error: An error occurred while rendering ActorSheet5eNPC2 30. Cannot read properties of undefined (reading 'passive') [Detected 2 packages: system:dnd5e(3.3.1), custom-dnd5e(0.14.0)] at Hooks.onError (foundry.js:654:24) at 🎁call_wrapped [as call_wrapped] (libWrapper-wrapper.js:507:22) at 🎁Hooks.onError#lib-wrapper (listeners.js:140:11) at 🎁Hooks.onError#0 (libWrapper-wrapper.js:187:52) at foundry.js:5795:13 onError @ foundry.js:655 10foundry.js:3698 Foundry VTT | Synchronized official game time in 5ms foundry.js:6347 Uncaught TypeError: undefined. Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'. [No packages detected] at ActorSheet5eNPC2.setPosition (foundry.js:6347:27) at _onWindowResize (foundry.js:10352:13)

Versions:

Larkinabout commented 2 weeks ago

I'll look in to what causes the error, but it's true that not every core skill is viable for removal where they are tied into other functionality. Same with removing abilities like Dex. I'd maybe consider renaming the skill instead so it retains the key for those functions, but is presented as something else.

Larkinabout commented 2 weeks ago

https://github.com/foundryvtt/dnd5e/issues/4076

Larkinabout commented 2 weeks ago

I've submitted a pull request for the dnd5e system to resolve this issue.