Welcome to the Builder Academy

Question Saving/Loading Varaibles with a long long int

More
29 Jun 2016 01:42 #6044 by Liko
Hello,
so in db.c you have simple_mobile and all that. It seems with a long long int it the variables will cause the game to crash. I have tried to set the variables with an %lli in sscanf and it produced errors. Any ideas? I honestly believe tbamud was never intended to use long long ints.

Randian(0.0.0)
Owner/Developer

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

More
30 Jun 2016 02:19 #6046 by Liko
I have fixed this issue :).

Randian(0.0.0)
Owner/Developer

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

More
02 Jul 2016 16:39 #6058 by krell
So what did you do? Change it to a long int?

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

More
03 Jul 2016 01:54 - 03 Jul 2016 01:54 #6074 by Liko

Krell wrote: So what did you do? Change it to a long int?


No sir. If i would have changed the default t[10] to an long long int(long int) it would of threw back tons of errors from the other variables only being ints. Instead I did long long int s[10] and in the line where POS is I defined it like so:
Code:
if (!get_line(mob_f, line)) { log("SYSERR: Format error in last line of mob #%d\n" "...expecting line of form '# # #', but file ended!", nr); exit(1); } if((retval = sscanf(line, " %d %d %d %lli ", t, t + 1, t + 2, s)) != 4) { if(retval == 0) { t[0] = 0; } else if(retval == 1) { t[0] = 0; t[1] = 0; } else if(retval == 2) { t[2] = 0; t[3] = 0; } else if(retval == 3) { s[0] = 0; } else { log("SYSERR: Format error in mob #%d, third line after S flag\n" "...expecting 4 arguments, but has %d", nr, retval); exit(1); } } GET_POS(mob_proto + i) = t[0]; GET_DEFAULT_POS(mob_proto + i) = t[1]; GET_SEX(mob_proto + i) = t[2]; GET_MAX_POWERLEVEL(mob_proto + i) = s[0];

Randian(0.0.0)
Owner/Developer
Last edit: 03 Jul 2016 01:54 by Liko.

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

Time to create page: 0.209 seconds