View Single Post
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-31-2012 , 02:51   Re: overkill, losing negative points?
Reply With Quote #8

Quote:
Originally Posted by HLM View Post
edit: one more question, if I want to make a check to see if it reaches the limit, should I check if its bigger than 2147483647, or should I check if it returns -1 ?
It's not possible for a number to be bigger than 2147483647. If the stored number is normally stored as positive and will never be negative then you should be able to check for less than 0.

I'm sure there is a method of simulating an unsigned integer (which never goes negative) but I'm not sure that it is worth it.

My best suggestion, however, is to modify how you calculate these "points" or whatever so that they don't gain them fast enough to reach such a limit. Another alternative would be to use a level system. When they reach a max value of "points" then you level them up and start the points over. So, the real point values would be calculated by (not literally):

real_points = level * max_points_per_level + points

This should make the real_points capable of reaching a max of (total_levels * max_points_per_level).
__________________
fysiks is offline