|
@@ -499,13 +499,13 @@ int mmo_char_fromstr(char *str, struct mmo_charstatus *p, struct global_reg *reg
|
|
char tmp_str[3][128]; //To avoid deleting chars with too long names.
|
|
char tmp_str[3][128]; //To avoid deleting chars with too long names.
|
|
int tmp_int[256];
|
|
int tmp_int[256];
|
|
unsigned int tmp_uint[2]; //To read exp....
|
|
unsigned int tmp_uint[2]; //To read exp....
|
|
- int set, next, len, i, j;
|
|
|
|
|
|
+ int next, len, i, j;
|
|
|
|
|
|
// initilialise character
|
|
// initilialise character
|
|
memset(p, '\0', sizeof(struct mmo_charstatus));
|
|
memset(p, '\0', sizeof(struct mmo_charstatus));
|
|
|
|
|
|
// Char structure of version 1500 (homun + mapindex maps)
|
|
// Char structure of version 1500 (homun + mapindex maps)
|
|
- if ((set = sscanf(str, "%d\t%d,%d\t%127[^\t]\t%d,%d,%d\t%u,%u,%d\t%d,%d,%d,%d\t%d,%d,%d,%d,%d,%d\t%d,%d"
|
|
|
|
|
|
+ if (sscanf(str, "%d\t%d,%d\t%127[^\t]\t%d,%d,%d\t%u,%u,%d\t%d,%d,%d,%d\t%d,%d,%d,%d,%d,%d\t%d,%d"
|
|
"\t%d,%d,%d\t%d,%d,%d,%d\t%d,%d,%d\t%d,%d,%d,%d,%d"
|
|
"\t%d,%d,%d\t%d,%d,%d,%d\t%d,%d,%d\t%d,%d,%d,%d,%d"
|
|
"\t%d,%d,%d\t%d,%d,%d,%d,%d,%d,%d,%d%n",
|
|
"\t%d,%d,%d\t%d,%d,%d,%d,%d,%d,%d,%d%n",
|
|
&tmp_int[0], &tmp_int[1], &tmp_int[2], tmp_str[0],
|
|
&tmp_int[0], &tmp_int[1], &tmp_int[2], tmp_str[0],
|
|
@@ -520,11 +520,11 @@ int mmo_char_fromstr(char *str, struct mmo_charstatus *p, struct global_reg *reg
|
|
&tmp_int[30], &tmp_int[31], &tmp_int[32], &tmp_int[33], &tmp_int[34],
|
|
&tmp_int[30], &tmp_int[31], &tmp_int[32], &tmp_int[33], &tmp_int[34],
|
|
&tmp_int[45], &tmp_int[35], &tmp_int[36],
|
|
&tmp_int[45], &tmp_int[35], &tmp_int[36],
|
|
&tmp_int[46], &tmp_int[37], &tmp_int[38], &tmp_int[39],
|
|
&tmp_int[46], &tmp_int[37], &tmp_int[38], &tmp_int[39],
|
|
- &tmp_int[40], &tmp_int[41], &tmp_int[42], &tmp_int[43], &next)) != 48)
|
|
|
|
|
|
+ &tmp_int[40], &tmp_int[41], &tmp_int[42], &tmp_int[43], &next) != 48)
|
|
{
|
|
{
|
|
tmp_int[44] = 0; //Hom ID.
|
|
tmp_int[44] = 0; //Hom ID.
|
|
// Char structure of version 1488 (fame field addition)
|
|
// Char structure of version 1488 (fame field addition)
|
|
- if ((set = sscanf(str, "%d\t%d,%d\t%127[^\t]\t%d,%d,%d\t%u,%u,%d\t%d,%d,%d,%d\t%d,%d,%d,%d,%d,%d\t%d,%d"
|
|
|
|
|
|
+ if (sscanf(str, "%d\t%d,%d\t%127[^\t]\t%d,%d,%d\t%u,%u,%d\t%d,%d,%d,%d\t%d,%d,%d,%d,%d,%d\t%d,%d"
|
|
"\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d,%d,%d"
|
|
"\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d,%d,%d"
|
|
"\t%127[^,],%d,%d\t%127[^,],%d,%d,%d,%d,%d,%d,%d%n",
|
|
"\t%127[^,],%d,%d\t%127[^,],%d,%d,%d,%d,%d,%d,%d%n",
|
|
&tmp_int[0], &tmp_int[1], &tmp_int[2], tmp_str[0],
|
|
&tmp_int[0], &tmp_int[1], &tmp_int[2], tmp_str[0],
|
|
@@ -539,11 +539,11 @@ int mmo_char_fromstr(char *str, struct mmo_charstatus *p, struct global_reg *reg
|
|
&tmp_int[30], &tmp_int[31], &tmp_int[32], &tmp_int[33], &tmp_int[34],
|
|
&tmp_int[30], &tmp_int[31], &tmp_int[32], &tmp_int[33], &tmp_int[34],
|
|
tmp_str[1], &tmp_int[35], &tmp_int[36],
|
|
tmp_str[1], &tmp_int[35], &tmp_int[36],
|
|
tmp_str[2], &tmp_int[37], &tmp_int[38], &tmp_int[39],
|
|
tmp_str[2], &tmp_int[37], &tmp_int[38], &tmp_int[39],
|
|
- &tmp_int[40], &tmp_int[41], &tmp_int[42], &tmp_int[43], &next)) != 47)
|
|
|
|
|
|
+ &tmp_int[40], &tmp_int[41], &tmp_int[42], &tmp_int[43], &next) != 47)
|
|
{
|
|
{
|
|
tmp_int[43] = 0; //Fame
|
|
tmp_int[43] = 0; //Fame
|
|
// Char structure of version 1363 (family data addition)
|
|
// Char structure of version 1363 (family data addition)
|
|
- if ((set = sscanf(str, "%d\t%d,%d\t%127[^\t]\t%d,%d,%d\t%u,%u,%d\t%d,%d,%d,%d\t%d,%d,%d,%d,%d,%d\t%d,%d"
|
|
|
|
|
|
+ if (sscanf(str, "%d\t%d,%d\t%127[^\t]\t%d,%d,%d\t%u,%u,%d\t%d,%d,%d,%d\t%d,%d,%d,%d,%d,%d\t%d,%d"
|
|
"\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d,%d,%d"
|
|
"\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d,%d,%d"
|
|
"\t%127[^,],%d,%d\t%127[^,],%d,%d,%d,%d,%d,%d%n",
|
|
"\t%127[^,],%d,%d\t%127[^,],%d,%d,%d,%d,%d,%d%n",
|
|
&tmp_int[0], &tmp_int[1], &tmp_int[2], tmp_str[0], //
|
|
&tmp_int[0], &tmp_int[1], &tmp_int[2], tmp_str[0], //
|
|
@@ -558,13 +558,13 @@ int mmo_char_fromstr(char *str, struct mmo_charstatus *p, struct global_reg *reg
|
|
&tmp_int[30], &tmp_int[31], &tmp_int[32], &tmp_int[33], &tmp_int[34],
|
|
&tmp_int[30], &tmp_int[31], &tmp_int[32], &tmp_int[33], &tmp_int[34],
|
|
tmp_str[1], &tmp_int[35], &tmp_int[36], //
|
|
tmp_str[1], &tmp_int[35], &tmp_int[36], //
|
|
tmp_str[2], &tmp_int[37], &tmp_int[38], &tmp_int[39],
|
|
tmp_str[2], &tmp_int[37], &tmp_int[38], &tmp_int[39],
|
|
- &tmp_int[40], &tmp_int[41], &tmp_int[42], &next)) != 46)
|
|
|
|
|
|
+ &tmp_int[40], &tmp_int[41], &tmp_int[42], &next) != 46)
|
|
{
|
|
{
|
|
tmp_int[40] = 0; // father
|
|
tmp_int[40] = 0; // father
|
|
tmp_int[41] = 0; // mother
|
|
tmp_int[41] = 0; // mother
|
|
tmp_int[42] = 0; // child
|
|
tmp_int[42] = 0; // child
|
|
// Char structure version 1008 (marriage partner addition)
|
|
// Char structure version 1008 (marriage partner addition)
|
|
- if ((set = sscanf(str, "%d\t%d,%d\t%127[^\t]\t%d,%d,%d\t%u,%u,%d\t%d,%d,%d,%d\t%d,%d,%d,%d,%d,%d\t%d,%d"
|
|
|
|
|
|
+ if (sscanf(str, "%d\t%d,%d\t%127[^\t]\t%d,%d,%d\t%u,%u,%d\t%d,%d,%d,%d\t%d,%d,%d,%d,%d,%d\t%d,%d"
|
|
"\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d,%d,%d"
|
|
"\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d,%d,%d"
|
|
"\t%127[^,],%d,%d\t%127[^,],%d,%d,%d%n",
|
|
"\t%127[^,],%d,%d\t%127[^,],%d,%d,%d%n",
|
|
&tmp_int[0], &tmp_int[1], &tmp_int[2], tmp_str[0], //
|
|
&tmp_int[0], &tmp_int[1], &tmp_int[2], tmp_str[0], //
|
|
@@ -578,11 +578,11 @@ int mmo_char_fromstr(char *str, struct mmo_charstatus *p, struct global_reg *reg
|
|
&tmp_int[27], &tmp_int[28], &tmp_int[29],
|
|
&tmp_int[27], &tmp_int[28], &tmp_int[29],
|
|
&tmp_int[30], &tmp_int[31], &tmp_int[32], &tmp_int[33], &tmp_int[34],
|
|
&tmp_int[30], &tmp_int[31], &tmp_int[32], &tmp_int[33], &tmp_int[34],
|
|
tmp_str[1], &tmp_int[35], &tmp_int[36], //
|
|
tmp_str[1], &tmp_int[35], &tmp_int[36], //
|
|
- tmp_str[2], &tmp_int[37], &tmp_int[38], &tmp_int[39], &next)) != 43)
|
|
|
|
|
|
+ tmp_str[2], &tmp_int[37], &tmp_int[38], &tmp_int[39], &next) != 43)
|
|
{
|
|
{
|
|
tmp_int[39] = 0; // partner id
|
|
tmp_int[39] = 0; // partner id
|
|
// Char structure version 384 (pet addition)
|
|
// Char structure version 384 (pet addition)
|
|
- if ((set = sscanf(str, "%d\t%d,%d\t%127[^\t]\t%d,%d,%d\t%u,%u,%d\t%d,%d,%d,%d\t%d,%d,%d,%d,%d,%d\t%d,%d"
|
|
|
|
|
|
+ if (sscanf(str, "%d\t%d,%d\t%127[^\t]\t%d,%d,%d\t%u,%u,%d\t%d,%d,%d,%d\t%d,%d,%d,%d,%d,%d\t%d,%d"
|
|
"\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d,%d,%d"
|
|
"\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d,%d,%d"
|
|
"\t%127[^,],%d,%d\t%127[^,],%d,%d%n",
|
|
"\t%127[^,],%d,%d\t%127[^,],%d,%d%n",
|
|
&tmp_int[0], &tmp_int[1], &tmp_int[2], tmp_str[0], //
|
|
&tmp_int[0], &tmp_int[1], &tmp_int[2], tmp_str[0], //
|
|
@@ -596,11 +596,11 @@ int mmo_char_fromstr(char *str, struct mmo_charstatus *p, struct global_reg *reg
|
|
&tmp_int[27], &tmp_int[28], &tmp_int[29],
|
|
&tmp_int[27], &tmp_int[28], &tmp_int[29],
|
|
&tmp_int[30], &tmp_int[31], &tmp_int[32], &tmp_int[33], &tmp_int[34],
|
|
&tmp_int[30], &tmp_int[31], &tmp_int[32], &tmp_int[33], &tmp_int[34],
|
|
tmp_str[1], &tmp_int[35], &tmp_int[36], //
|
|
tmp_str[1], &tmp_int[35], &tmp_int[36], //
|
|
- tmp_str[2], &tmp_int[37], &tmp_int[38], &next)) != 42)
|
|
|
|
|
|
+ tmp_str[2], &tmp_int[37], &tmp_int[38], &next) != 42)
|
|
{
|
|
{
|
|
tmp_int[26] = 0; // pet id
|
|
tmp_int[26] = 0; // pet id
|
|
// Char structure of a version 1 (original data structure)
|
|
// Char structure of a version 1 (original data structure)
|
|
- if ((set = sscanf(str, "%d\t%d,%d\t%127[^\t]\t%d,%d,%d\t%u,%u,%d\t%d,%d,%d,%d\t%d,%d,%d,%d,%d,%d\t%d,%d"
|
|
|
|
|
|
+ if (sscanf(str, "%d\t%d,%d\t%127[^\t]\t%d,%d,%d\t%u,%u,%d\t%d,%d,%d,%d\t%d,%d,%d,%d,%d,%d\t%d,%d"
|
|
"\t%d,%d,%d\t%d,%d\t%d,%d,%d\t%d,%d,%d,%d,%d"
|
|
"\t%d,%d,%d\t%d,%d\t%d,%d,%d\t%d,%d,%d,%d,%d"
|
|
"\t%127[^,],%d,%d\t%127[^,],%d,%d%n",
|
|
"\t%127[^,],%d,%d\t%127[^,],%d,%d%n",
|
|
&tmp_int[0], &tmp_int[1], &tmp_int[2], tmp_str[0], //
|
|
&tmp_int[0], &tmp_int[1], &tmp_int[2], tmp_str[0], //
|
|
@@ -614,7 +614,7 @@ int mmo_char_fromstr(char *str, struct mmo_charstatus *p, struct global_reg *reg
|
|
&tmp_int[27], &tmp_int[28], &tmp_int[29],
|
|
&tmp_int[27], &tmp_int[28], &tmp_int[29],
|
|
&tmp_int[30], &tmp_int[31], &tmp_int[32], &tmp_int[33], &tmp_int[34],
|
|
&tmp_int[30], &tmp_int[31], &tmp_int[32], &tmp_int[33], &tmp_int[34],
|
|
tmp_str[1], &tmp_int[35], &tmp_int[36], //
|
|
tmp_str[1], &tmp_int[35], &tmp_int[36], //
|
|
- tmp_str[2], &tmp_int[37], &tmp_int[38], &next)) != 41)
|
|
|
|
|
|
+ tmp_str[2], &tmp_int[37], &tmp_int[38], &next) != 41)
|
|
{
|
|
{
|
|
ShowError("Char-loading: Unrecognized character data version, info lost!\n");
|
|
ShowError("Char-loading: Unrecognized character data version, info lost!\n");
|
|
ShowDebug("Character info: %s\n", str);
|
|
ShowDebug("Character info: %s\n", str);
|