Currency - Stack Overflow

r@t

New member
Hey,

Having an issue with stack overflow when adding currency.
Here's an overview of the amounts.
opsive-currency.png

Here's an overview of the scripts.
On interact, run my custom extension.
cur1.png
Here's the extension. it's using the "currencyOwner.CurrencyAmount" accessor, then AddCurrency/RemoveCurrency

cur2.png

The issue doesn't seem to occur when adding "iron". Iron will automatically add up. Remove currency also seems to work. It's add currency with non-iron currencies which is causing the issue (which is all of them).

See attached file for error.
 

Attachments

  • StackOverflowException The requeste.txt
    16 KB · Views: 0
The issue probabl comes from this part
1703090419774.png


Maximum you can have 99 Silver. Then it should convert to Gold. But 1 Gold is 1000 Silver.
So when you have 100 Silver it has to overflow to 0.1Gold.
But decimal currency is not allowed so it reverts back to 100 Silver... And then it loop infinetly

Try either seting the base exchange rate of the Gold to 100, or the Silver Max amount to 999
 
Top