matronator / GlobalCollapse

Browser-based MMORPG based around the COVID pandemic. PWA supported.

Home Page:https://global-collapse.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Money runs into int32 overflow

gerbenjacobs opened this issue · comments

Describe the bug
Money runs into int32 overflow. I sold 66,332,326 meth at $65 which should give me $4.311.601.190; however my balance turned to 2,147,483,647.

To Reproduce
Steps to reproduce the behavior:

  1. Sell drugs at Darknet resulting in more than $2,147,483,647

Expected behavior
66,332,326 * 65 should result in $4.311.601.190 in my wallet.

Desktop (please complete the following information):

  • OS: Windows
  • Browser: Chrome

Hi, thank you for reporting! I'll get on to it right right away.

Instead of switching to bigInt or floats, I decided to cap the money player can have at $999,999,999, because I'm planning on changing how the Darknet works a bit so it won't be exponentially growing profits anymore