Today I found shop stands offering items for 99,999,999c each. Could not resist to test out how the game handles such big numbers
Result is that the total overflows when going over 4.2 billion (2^32, unsigned integer). So buying 43 of those items just costs me 5,032,704c. Have not found a combination to get it nearly free but better to handle this correctly before somebody with a different price that results in a low total gets robbed.
Yea it should get fixed tho it may just be a visual bug(would have to test on test servers but I don’t have pc copy) But who has 5mil to blow on 43 items anyhow.
It’s 2^31 because it’s 2’s-complement representation. Also, signed integer overflow is underfined behaviour in C++, so it’s possible it would just crash the server instead of wrapping, depending on the command-line options passed to the compiler.
I’ve checked this in game and couldn’t reproduce this issue. However, after discussing this with one of the software engineers, it could be that this may have been fixed with the next incoming update. Check this again when the live game is up to date.