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

Modifying the .mod property of a skill directly breaks the character sheet so that it disappears #169

Open
1 task done
damccull opened this issue Nov 21, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@damccull
Copy link
Contributor

damccull commented Nov 21, 2024

Describe the bug
If you modify system.skills.<skill>.mod with an item effect (and probably other things too) it will break the character sheet in a way that makes it fail to render.

Only seems to happen when using a cosmere-specific type. Path and Ancestry can trigger it, but Armor and Weapon do not.

To Reproduce
Steps to reproduce the behavior:

  1. Create or modify an item that is cosmere-system specific to add an effect
  2. Enter system.skills.agi.mod as the target, choose 'add' and enter the value '1'
  3. Save the item
  4. Drag the item onto the character sheet

Expected behavior
Sheet should display a default value or an error in place of the text for the value but not disappear entirely.

Screenshots
image

Foundry VTT Version
12 build 331

Cosmere RPG System Version
0.2.0

Browser
Firefox

Additional context
Javascript console errors:

Uncaught (in promise) Error: Failed to render Application "CharacterSheet-Actor.4DtwAZF7AtMx2aG5":
cannot use 'in' operator to search for "bonus" in "[object Object][..."
[No packages detected]
    #render https://fvtt.digitalmccullough.com/scripts/foundry-esm.js:44349
Caused by: TypeError: cannot use 'in' operator to search for "bonus" in "[object Object][..."
    getValue https://fvtt.digitalmccullough.com/systems/cosmere-rpg/index.js:1150
    <anonymous> https://fvtt.digitalmccullough.com/systems/cosmere-rpg/index.js:1491
    c https://fvtt.digitalmccullough.com/scripts/handlebars.min.js:27
    anonymous https://fvtt.digitalmccullough.com/scripts/handlebars.min.js line 29 > Function:11
    c https://fvtt.digitalmccullough.com/scripts/handlebars.min.js:27
    d https://fvtt.digitalmccullough.com/scripts/handlebars.min.js:27
    e https://fvtt.digitalmccullough.com/scripts/handlebars.min.js:28
    renderTemplate https://fvtt.digitalmccullough.com/scripts/foundry.js:7902
9 [foundry-esm.js:44349:15](https://fvtt.digitalmccullough.com/scripts/foundry-esm.js)
Error: Failed data preparation for Actor.4DtwAZF7AtMx2aG5. can't assign to property "value" on "[object Object][object Object]": not an object
[Detected 1 package: system:cosmere-rpg(0.2.0)]
    onError foundry.js:654
    onError#0 libWrapper-wrapper.js:188
    _safePrepareData foundry.js:10801
    _initialize foundry.js:10630
    _initialize index.js:7845
    updateSource foundry-esm.js:10520
    fromDropData foundry.js:11501
Caused by: TypeError: can't assign to property "value" on "[object Object][object Object]": not an object
[Detected 1 package: system:cosmere-rpg(0.2.0)]
    prepareDerivedData https://fvtt.digitalmccullough.com/systems/cosmere-rpg/index.js:7323
    prepareDerivedData https://fvtt.digitalmccullough.com/systems/cosmere-rpg/index.js:7311
    prepareDerivedData https://fvtt.digitalmccullough.com/systems/cosmere-rpg/index.js:7472
    prepareData https://fvtt.digitalmccullough.com/scripts/foundry.js:10823
    prepareData https://fvtt.digitalmccullough.com/scripts/foundry.js:15863
    _safePrepareData https://fvtt.digitalmccullough.com/scripts/foundry.js:10799
    _initialize https://fvtt.digitalmccullough.com/scripts/foundry.js:10630
    _initialize https://fvtt.digitalmccullough.com/systems/cosmere-rpg/index.js:7845
    updateSource https://fvtt.digitalmccullough.com/scripts/foundry-esm.js:10520
    fromDropData https://fvtt.digitalmccullough.com/scripts/foundry.js:11501
[foundry.js:655:30](https://fvtt.digitalmccullough.com/scripts/foundry.js)
Uncaught (in promise) Error: Failed to render Application "CharacterSheet-Actor.4DtwAZF7AtMx2aG5":
cannot use 'in' operator to search for "bonus" in "[object Object][..."
[No packages detected]
    #render https://fvtt.digitalmccullough.com/scripts/foundry-esm.js:44349
Caused by: TypeError: cannot use 'in' operator to search for "bonus" in "[object Object][..."
    getValue https://fvtt.digitalmccullough.com/systems/cosmere-rpg/index.js:1150
    <anonymous> https://fvtt.digitalmccullough.com/systems/cosmere-rpg/index.js:1491
    c https://fvtt.digitalmccullough.com/scripts/handlebars.min.js:27
    anonymous https://fvtt.digitalmccullough.com/scripts/handlebars.min.js line 29 > Function:11
    c https://fvtt.digitalmccullough.com/scripts/handlebars.min.js:27
    d https://fvtt.digitalmccullough.com/scripts/handlebars.min.js:27
    e https://fvtt.digitalmccullough.com/scripts/handlebars.min.js:28
    renderTemplate https://fvtt.digitalmccullough.com/scripts/foundry.js:7902
[foundry-esm.js:44349:15](https://fvtt.digitalmccullough.com/scripts/foundry-esm.js)

Checklist:

  • I have searched the existing issues to ensure this bug has not already been reported
@damccull damccull added the bug Something isn't working label Nov 21, 2024
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