vttred / ose

Old-School Essentials – Foundry VTT Edition
https://ose.vtt.red
GNU General Public License v3.0
96 stars 52 forks source link

Encumbrance fix #467

Closed Typhos closed 5 months ago

Typhos commented 12 months ago

I noticed that the encumbrance bar seemed to be broken, so I updated the code to return it to its working state. Additionally, I added a quick function to change the color of the bar to indicate how encumbered a character is (green, yellow, orange, red).

anthonyronda commented 11 months ago

thanks, I'll review today :)

Typhos commented 11 months ago

I noticed a bug in the encumbrance percentage calculation when I was transferring my fixes manually into my local instance so I could have them for my next session. It looks like the delta value was actually causing the percentages to be incorrect if you use non-standard carrying weights (I have STR modify carrying capacity by 300 per +1). It was working as expected when capacity had a delta of zero.

I removed this.#delta from the calculations, which fixed this bug for the bar color feature. I didn't remove #delta from the model incase there might be a use for it later in some other feature.

anthonyronda commented 5 months ago

We thank you so much for your contribution. It turns out that another contributor was able to come up with a nice solution and answer the review feedback before you did. Thanks a lot though!