You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've noticed a weird issue where if a feature pulls from one of the primary/secondary/tertiary resources on the sheet, if the value of that resource is 0, rather than being told the resource is out of charges, it says that the attribute no longer exists.
This has a separate knock-on effect if you edit a feature on a character while the resource is 0, which is that the attribute disappears from the list, e.g:
character with resource at 0:
attribute options:
Which means if you happen to edit a feature while its linked resource is 0, it immediately delinks the resource even if you make no other changes.
I'm happy to raise a PR to either remove that line of code or replace it with a null, but as I have no other experience with the module, I don't know what this has the potential to break.
The text was updated successfully, but these errors were encountered:
Hi folks,
I've noticed a weird issue where if a feature pulls from one of the primary/secondary/tertiary resources on the sheet, if the value of that resource is 0, rather than being told the resource is out of charges, it says that the attribute no longer exists.
This has a separate knock-on effect if you edit a feature on a character while the resource is 0, which is that the attribute disappears from the list, e.g:
![image](https://user-images.githubusercontent.com/1389994/224042319-7459a305-aa9f-4380-af49-d3278c95bd98.png)
![image](https://user-images.githubusercontent.com/1389994/224042669-8e83cfa9-7afb-46d7-98f8-5998fcbed351.png)
character with resource at 0:
attribute options:
Which means if you happen to edit a feature while its linked resource is 0, it immediately delinks the resource even if you make no other changes.
I believe this is down to this line of code: https://github.com/foundryvtt/dnd5e/blob/master/module/applications/actor/character-sheet.mjs#L30 where the value is deleted if the resource exists and the value is 0 - though if the resource is unconfigured, it returns a
null
instead, e.g:I'm happy to raise a PR to either remove that line of code or replace it with a null, but as I have no other experience with the module, I don't know what this has the potential to break.
The text was updated successfully, but these errors were encountered: