morepurplemorebetter / MPMBs-Character-Record-Sheet

MorePurpleMoreBetter's D&D 5e Character Record Sheet
https://www.flapkan.com
GNU General Public License v3.0
372 stars 352 forks source link

Subclasses feature `spellChanges` aren't removed when the subclass is removed #119

Closed DysnomianC closed 2 years ago

DysnomianC commented 2 years ago

Sheet version 13.1.0

To reproduce:

Activate a subclass that has a spellChanges feature such as the grave domain cleric, which changes the spare the dying cantrip. Generate a spell sheet that includes the spell in the above feature. Change subclass to one that doesn't have that feature. Regenerate a spell sheet that includes the spell in the above feature.

Intended behaviour:

The spell should show the default spell behaviour (eg casting time 1a, range touch for spare the dying).

Actual behaviour:

The spell sheet generates with the altered text from the spellChanges feature (ie casting time 1bns, range 30ft for spare the dying).

Workaround:

At the moment I'm manually editing the spell details each time I have to regenerate the spell sheet.

Notes:

Attached is an example of the js that adds the feature causing the issue.

grave domain cleric subclass.js.txt

morepurplemorebetter commented 2 years ago

Thank you for reporting this issue. It is a known issue and stems from a bug in Adobe Acrobat. The problem is that Adobe Acrobat uses global variable prototypes, instead of per open PDF. This means that if you open the latest sheet, but consequently open an older version of the sheet, old code will be used instead of the correct one. The exact problem is Array.prototype.search (here).

I have a fix ready for the next version, but in the meantime you can prevent this from happening by not opening any other versions of the character sheet after you open the latest version.

Also, thank you for including an example, but I would like to ask to please refrain from publicly sharing my PDFs outside of their distribution channels. Would you mind editing your submission and deleting the attachments? If not, I will resolve to deleting the whole issue, but then it won't be saved for others to find.

DysnomianC commented 2 years ago

Thank you for your detailed reply, it's extremely satisfying the way you give such a thorough explanation for the issue, so thank you.

Wrt the example, my apologies, I didn't think of that - I've now removed the pdf attachment.