View Single Post
  #8  
Old January 29th, 2013, 03:32 PM
Mobhack's Avatar

Mobhack Mobhack is offline
National Security Advisor
 
Join Date: Mar 2005
Location: Dundee
Posts: 5,988
Thanks: 481
Thanked 1,922 Times in 1,250 Posts
Mobhack is on a distinguished road
Default Re: Help please: Rebuild Points are Negative

Quote:
Originally Posted by Mobhack View Post
Hmm - I put the points up to the maximum, and bought a huge amount of challengers for a 64K core. Then bought 10K more at the end of the next battle and so on. Points values all were being handled well - was up to 90K core value soon enough. Points did not roll over to a negative value.

However - a mass deletion of core troops soon made the numbers go funny.. So something is wrong in there - probably old code that has not been updated to a 32 bit value for the points total, likely a 16 bit integer internal to the delete routine - will be investigating that later tomorrow.

So - did you happen to do a mass deletion at some point?
OK - found the culprit that was stuffing a signed 32 bit value into an unsigned 16 bit value and so blowing the delete code up.

Unfortunately, the relevant value is squirrelled away in the save game data as a 16 bit - so its a bit more involved than just changing the variable's type in a function.

I'll need to deal with legacy scenarios and saved games with the obsolete variable (and add new 32 bit ones to the save game files)... data massage tango, here we go!
Reply With Quote
The Following User Says Thank You to Mobhack For This Useful Post: