I want to add three fields to the class area of the who list..
Here's the code i've tried:
strcpy( char_name, wch->name );
if (wch->classtwo != -1 && wch->classthree != -1)
sprintf( class_text, "%s%2d %s|%s|%s", NOT_AUTHED(wch) ? "N" : " ", wch->level,
class_table[wch->class]->who_name, class_table[wch->classtwo]->who_name,
class_table[wch->classthree]->who_name );
else if (wch->classtwo != -1 && wch->classthree == -1)
sprintf( class_text, "%s%2d %s|%s|%s", NOT_AUTHED(wch) ? "N" : " ", wch->level,
class_table[wch->class]->who_name, class_table[wch->classtwo]->who_name,
class_table[wch->classthree]->who_name );
else if (wch->classtwo == -1 && wch->classthree == -1)
sprintf( class_text, "%s%2d %s|%s|%s", NOT_AUTHED(wch) ? "N" : " ", wch->level,
class_table[wch->class]->who_name );
class = class_text;
But all that does is crash when the first or second ones come out true
Here's the code i've tried:
strcpy( char_name, wch->name );
if (wch->classtwo != -1 && wch->classthree != -1)
sprintf( class_text, "%s%2d %s|%s|%s", NOT_AUTHED(wch) ? "N" : " ", wch->level,
class_table[wch->class]->who_name, class_table[wch->classtwo]->who_name,
class_table[wch->classthree]->who_name );
else if (wch->classtwo != -1 && wch->classthree == -1)
sprintf( class_text, "%s%2d %s|%s|%s", NOT_AUTHED(wch) ? "N" : " ", wch->level,
class_table[wch->class]->who_name, class_table[wch->classtwo]->who_name,
class_table[wch->classthree]->who_name );
else if (wch->classtwo == -1 && wch->classthree == -1)
sprintf( class_text, "%s%2d %s|%s|%s", NOT_AUTHED(wch) ? "N" : " ", wch->level,
class_table[wch->class]->who_name );
class = class_text;
But all that does is crash when the first or second ones come out true