Closed Altrix1 closed 2 years ago
Jeah same problem here
I am getting the same issue. It always seems to multiple the platinum in a weird way. For instance if they have 500 gp and purchase a 50gp item they are given 4995pp always. If they have 500gp and purchase an item for 5 gp they always get 4999.5. It is consistent.
I am able to replicate in a world with only this module enabled. Tested in a different world with only this module enabled and I could not replicate. Same settings on the module.
Module version - 3.5.10 Operating system - Win10 Browser version - Chrome Version 101.0.4951.67, Microsoft Edge Version 101.0.1210.53, Brave Version 1.39.111, Firefox 100.0.2 Foundry version - 9.269 Errors in console - no errors
I Will take a look into currency conversion again.
I believe this issue is due to _getFundsAsPlatinum
, starting at line 464 in TradeHelper.js
:
fundsAsPlatinum += funds.gp / rates.pp;
fundsAsPlatinum += (funds.ep / rates.gp) / rates.pp;
fundsAsPlatinum += (funds.sp / rates.gp) / rates.pp;
fundsAsPlatinum += (funds.cp / rates.gp) / rates.pp;
This code is dividing gp funds by the pp rate, which is defined as 0.1
, thus it is multiplying gp by 10 to convert to pp, rather than diving by 10.
@Ameranth thanks alot
Will try to get it into the next release (which I finish currently)
Awesome, thank you very much for your work!
When I buy from a merchant I get platinum.
![Zrzut ekranu 2022-05-14 131351](https://user-images.githubusercontent.com/86872105/168423503-3882119d-6460-416b-8ed2-a92676c755b2.png)