CarlosFdez / pf2e-persistent-damage

Keeps track of persistent damage on actors for PF2E for Foundry VTT
5 stars 4 forks source link

Unbalanced group missing opening { or closing } when clicking on an action with levelled damage #22

Closed Cerapter closed 2 years ago

Cerapter commented 2 years ago

Foundry version: 9 Pathfinder system version: 3.2.1.10003 Modules enabled: PF2E persistent damage

While this module is enabled, opening up an action that has levelled damage in its description will fail with the following error:

[Detected 2 packages: pf2e-persistent-damage, system:pf2e]
    _splitGroup https://foundry.cerapter.me/scripts/foundry.js:7232
    _splitPools https://foundry.cerapter.me/scripts/foundry.js:7145
    terms https://foundry.cerapter.me/scripts/foundry.js:7010
    parse https://foundry.cerapter.me/scripts/foundry.js:7009
    Roll https://foundry.cerapter.me/scripts/foundry.js:6562
    t https://foundry.cerapter.me/modules/pf2e-persistent-damage/index.js:1
    enrichHTML https://foundry.cerapter.me/modules/pf2e-persistent-damage/index.js:1
    enrichHTML https://foundry.cerapter.me/modules/pf2e-persistent-damage/index.js:1
    enrichHTML https://foundry.cerapter.me/systems/pf2e/main.bundle.js:1
    registerHandlebarsHelpers https://foundry.cerapter.me/systems/pf2e/main.bundle.js:1
    c https://foundry.cerapter.me/scripts/handlebars.min.js:27
    anonymous https://foundry.cerapter.me/scripts/handlebars.min.js line 29 > Function:29
    c https://foundry.cerapter.me/scripts/handlebars.min.js:27
    d https://foundry.cerapter.me/scripts/handlebars.min.js:27
    e https://foundry.cerapter.me/scripts/handlebars.min.js:28
    renderTemplate https://foundry.cerapter.me/scripts/foundry.js:4692
foundry.js:316:28

In this case, I was trying to open up "Breath Weapon (Acid) (Cone)", but any Breath Weapon except the basic Breath Weapon action will result in similar errors.

If you remove the

At 3rd level and every 2 levels thereafter, the damage increases by 1d6. [[/r {(floor(@actor.level/2))d6}[acid]]]{Levelled Damage}

line from the action's descroption, Persistent Damage no longer complains. Without any modules enabled, there are no issues with looking at the full description.

If you remove the line from the description, enable Persistent Damage, and then add it back, the description is left uninterpreted even after you press save:

Barebones description after saving

CarlosFdez commented 2 years ago

Interesting. This is actually an issue in core Foundry that people weren't aware of and left in the core system, that the persistent damage module made worse by not working around.

I can't make it work, but I can avoid the sheet failure, which is the best I can do.

CarlosFdez commented 2 years ago

That said there is an issue without persistent damage. Look at the "Levelled Damage". It doesn't work.