BUG: ATM Balance Overflow
ookkoouu opened this issue ยท 4 comments
Minecraft Version
1.20.1
Forge Version
47.2.20
Lightman's Currency Version
2.2.1.0b
Environment Type
Dedicated Server (Bug/crash happened while connected to a server or while the dedicated server was booting)
Other relevant Mods
No response
Describe the bug
Depositing more than 2147483648 at the ATM will result in a zero balance.
To Reproduce
- Rise all
exchangeRate
to 100 - Deposit above 21d47e48g36i48c to ATM
Screenshots/Logs/Crash Reports
I believe I have found the issue, and the issue was annoying enough caused by my coin entry sorters sorting the available entries backwards, meaning all coin values generated from a raw long value (which is done whenever coin values are added to each other) were always compared to the copper coins value first, instead of the netherite coins value. And since each "coin entry" portion of a coin value is stored as an integer instead of a long, it was thus limited to the maximum integer value (as copper coins are always worth 1
)
This will be fixed in the next build, and conveniently enough this should also help some of the other lag issues I've been trying to resolve, as now money values will be calculated correctly the first time, instead of being calculated as a large number of copper coins and then rounded again later in a slightly less efficient method.
I'll look into it. No clue why it's being limited by the integer maximum when money values are long-based, but I'll do some testing to see if I can figure out why this is happening regardless...