World of Warcraft Gold Limit Reached, It's 2^31
Mitch writes "Blizzard apparently used signed integers for their World of Warcraft gold values as some people have recently hit the limit of 2^31. "Apparently that amount is 214,748 gold, 36 silver, 48 copper. After you reach that lofty sum, you'll no longer be able to receive money from any source in the game. While some responses to the original posts claim that this exact limit had previously been theorized to exist, there have been no reports of anyone in the game actually achieving this amount via legal means." I guess Blizzard didn't expect anyone to ever get close to that much gold in game."
There's not a real economy in WoW, per say. You get most of your money from quests and kills, which is pretty well-regulated (in the sense that lower level mobs and quests give lower amounts of money, and there's a limit to what you can kill and loot), and you spend most of it in NPC shops. The only semblance of an economy is the auction house and trade channels.
The fact that most of your money disappears into NPC shops with set prices keeps inflation from happening.
Signed integers are used all the time for strictly positive values. For most purposes it is more convenient to just utilize the standard signed integer, and perform range checking to ensure it's positive.
(You need to range check unsigned integers too, it's not as if switching to an unsigned integer relieves you of any problems, other than that it increases the 2^31-1 limit to a 2^32-1 limit.)
The player should be thankful that the only consequence is they can't receive more gold from other players, rather than finding they have a _VERY_ negative amount of gold (less than zero).
In many C based programs, your gold would overflow and drop to (-2^31+1), -2147483647, since the C programming language doesn't offer the programmer any exception handling mechanism for overflow detection (overflows are silently allowed to happen), and game developers don't necessarily anticipate such extremes.