Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!
If you stick to the int the players get a negative amount of mesos after you multiple the price of an item and the amount of items. Therefore you need to make sure that total amount of mesos after multiplying isn't negative.
@flav Honestly, its smarter to use a long that way its guaranteed that the int won't become negative.
@mertjuh Using an integer defeats the entire purpose of this fix. What usually happens when you exceed (2^31 -1) the integer value becomes negative. However using a long expands the capacity of the value making the cap (2^63 -1). Besides, not many arithmetic operations can exceed (2^63 -1) unless your doing the very thing.
@flav Honestly, its smarter to use a long that way its guaranteed that the int won't become negative.
@mertjuh Using an integer defeats the entire purpose of this fix. What usually happens when you exceed (2^31 -1) the integer value becomes negative. However using a long expands the capacity of the value making the cap (2^63 -1). Besides, not many arithmetic operations can exceed (2^63 -1) unless your doing the very thing.