ardittristan / 5eSheet-resourcesPlus

A module that allows you to add more resources to 5e character sheets
GNU General Public License v3.0
9 stars 5 forks source link

[BUG] Resources.primary.value disappears when a resource is at 0 #42

Open SLinxTheFox opened 3 months ago

SLinxTheFox commented 3 months ago

Because the value part doesn't exist on the actor when it's set to 0, it breaks modules like rest recovery that try to interact with it and add resources to it. When this module is disabled the value is just set to 0

Simply removing this line "if (res && res.value === 0 && res.name != "count") delete res.value;" worked for me in the short term

idk if this was to reduce actor sheet clutter from this module, but it would be nice to have it removed or reworked for the sake of anything that calls on a fully depleted resource