Thread: Bad LDON bug
View Single Post
  #7  
Old 06-01-2011, 06:49 AM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,742
Default

That may "work", but it isn't correct. The type of those variables is sint32, so they can never be larger than 0x7FFFFFFF and the second check is meaningless.

Do you really expect someone to accumulate over 2 billion points? If they somehow do that, do you want them to lose them all when they accumulate too many?

If it was me, I'd prefer capping the points rather than setting them to 0.

Something like this and adjusting the number to be the maximum you want them to have saved or to fit the UI:
Code:
if(m_pp.ldon_points_guk < 0) m_pp.ldon_points_guk = 0;
if(m_pp.ldon_points_guk > 999999) m_pp.ldon_points_guk = 999999;
That is the only place you would need to make this particular change as far as I can see, but you would need to test with numbers approaching and exceeding whatever limit you decide on to see if there are any other issues.
Reply With Quote