syl3r86 / inventory-plus

A Foundry VTT module to enhance the dnd5e inventory. Allows to customize your Inventory in various ways.
8 stars 12 forks source link

Bug-fix: NaN carry weight with "Coin Weight" enabled #29

Closed josmardias closed 2 years ago

josmardias commented 2 years ago

This is a replacement for #28, removing the cleanup and focusing on the bugfix, but keeping the original commiter.

I created this replacement because I think that the module author is not interested in cleanups, this same author didn't merge previous PR, instead did the changes directly on the codebase after acknowledging and thanking for the previous PRs. The author is indeed the single commiter of the repo, so any cleanups are just noises. I mean no disrespect to the commiter, I just want to speed up the process.

Copy and paste of the original description:

After updating to DnD5e system 1.4.x, the total weight bar at the bottom of the inventory tab shows as NaN/{Carry Capacity}
(Issue #27).

This calculation error is happening because the system added the ability to switch between metric and imperial unit calculation.

CONFIG.DND5E.encumbrance.currencyPerWeight

This line now fetches an object containing the new conversion units.

The commit fixes this issue by providing a simple decision to determine the game settings measurement units.
ZeroXNoxus commented 2 years ago

It seems like this module might be dead, @syl3r86 still hasn't merged. Any ideas what we could do, @josmardias?

josmardias commented 2 years ago

I applied this patch on my local files (on Linux ~/.local/share/FoundryVTT/Data/modules/inventory-plus/inventory-plus.js) so I'm not really waiting on the maintainer to merge and release this patch.

If the maintainer decides to release a new version without this patch, then I'll have to reapply it.

Starting a fork would be a solution but I'll avoid it until there is no other way.

josmardias commented 2 years ago

A fork like this, in case you wondering: https://github.com/lplewa/inventory-plus/commit/20d350cb5fb19cb2edae29357e9dbaa8d15202c2

josmardias commented 2 years ago

Merged on https://github.com/syl3r86/inventory-plus/commit/de5824b8c2ffc373306689bf32e108fa0de692e1