Gold amount overflow

The gold amount overflows when it is over INT_MAX. This is often the case when you have a lot of Rampart towns, each has Treasury built, and then your gold amount multiplies on the first day of each week, After you have played long enough, it will eventually hit the limit and fall back to 0. (12 weeks is enough if you have 12 Ramparts and you don’t consume it. When I was playing a modified version of the map Pandora’s Box, I captured 9 Ramparts, and it just took me about 15 weeks to hit that limit.)

It might be better to limit it to a specific value, like 1e10 or so, rather than letting it to overflow and fall back.

Btw, any approach for a mod to modify the map when playing?

It absolutely should not, gold income is limited at 1 billion or something.

At least it was when I implemented it, but can’t quite find that in code anymore :/. Resources are added directly via property instead of any method…

But it actually happens, and the same in the marketplace.
image
and also
125
Version 1.3.2

I’ve opened an issue on GitHub about this gold overflow · Issue #2963 · vcmi/vcmi · GitHub

1 Like

Thanks, and it would be great if the amount could be displayed in short form, as mentioned in your reply. (so that 1e13 (10000000M) could be presented without overflowing.)