Welcome to the Builder Academy

Question Question about saving/loading

More
06 Apr 2014 00:11 #4811 by Liko
Hello,

Even tho I changed gold/bank gold to a long long. If the player goes over 2.14b and logs out the game will revert their amount back to 2.14b. Why is this? A long long should be able to save/loud more than 2.14 amount.

Sincerely,

Liko

Randian(0.0.0)
Owner/Developer

Please Log in or Create an account to join the conversation.

More
06 Apr 2014 20:00 #4813 by thomas
have you altered every single place that money is handled? Also the load and save routines?
Code:
case 'G': if (!strcmp(tag, "Gold")) GET_GOLD(ch) = atoi(line); break;
atoll and the corresponding %lld or %llu for writing it in the sprintf.

Please Log in or Create an account to join the conversation.

More
06 Apr 2014 21:42 #4814 by Liko
Replied by Liko on topic Question about saving/loading

thomas wrote: have you altered every single place that money is handled? Also the load and save routines?

Code:
case 'G': if (!strcmp(tag, "Gold")) GET_GOLD(ch) = atoi(line); break;
atoll and the corresponding %lld or %llu for writing it in the sprintf.


Code:
if (GET_GOLD(ch) != PFDEF_GOLD) fprintf(fl, "Gold: %Ld\n", GET_GOLD(ch)); if (GET_BANK_GOLD(ch) != PFDEF_BANK) fprintf(fl, "Bank: %Ld\n", GET_BANK_GOLD(ch));

Indeed I have.

That is why I'm wondering If it is not something more.

Randian(0.0.0)
Owner/Developer

Please Log in or Create an account to join the conversation.

More
10 Apr 2014 00:42 #4826 by Liko
Replied by Liko on topic Question about saving/loading
Anyone?

Randian(0.0.0)
Owner/Developer

Please Log in or Create an account to join the conversation.

More
12 Apr 2014 12:20 #4830 by thomas
If you set someones gold to 6billion - what's in the save file? This should narrow it down a bit.

Please Log in or Create an account to join the conversation.

More
12 Apr 2014 16:49 - 12 Apr 2014 16:51 #4831 by Liko
Replied by Liko on topic Question about saving/loading

thomas wrote: If you set someones gold to 6billion - what's in the save file? This should narrow it down a bit.


On Logout:
Code:
Con : 10000 Cha : 10000 Ac : 100 Gold: 10000000000 Exp : 7000000 Hrol: 300 Drol: 300 Olc : 0

But yet when I log back in it changes to:
Code:
Con : 10000 Cha : 10000 Ac : 100 Gold: 2147483647 Exp : 7000000 Hrol: 300 Drol: 300 Olc : 0

Randian(0.0.0)
Owner/Developer
Last edit: 12 Apr 2014 16:51 by Liko.

Please Log in or Create an account to join the conversation.

Time to create page: 0.259 seconds