I made a variable in mud.h that is unsigned long long, and displayed it with %llu. Now when I do a copyover, and the number is above 2 billion (or whatever the last number was) it changes to another number, seemingly a random one, like 18446744072414584320. Could anyone help me with this?
Unsigned number problem
Posted by Zeno on Fri 18 Jul 2003 01:25 AM — 8 posts, 19,629 views.
Ok, I know what it is, kinda. I'm getting a overflow whenever a copyover is done. If the variable is below 2bil (int) then it doesn't overflow. But I don't know how to fix it. I'm still looking into it, but if someone could reply, it'd save me time.
I haven't used copyover so I can't help, sorry. How does the player data get saved and restored after a copyover? Is there a temporary variable that is only an int, for instance?
Actually it happens also with a reboot, so its not copyover.
Check how the variable is read in - the read routine is probably not designed for long long.
Err, where would I find that?
You said you made a variable - where do you save it, and where do you read it in on a restart? If you don't know that, then it probably isn't read in anyway. Try searching for the variable name in all the .c files.
My bad. I just had to change fread_number to unsigned long long.