> [210 Giant ] Khoren (null)
>
> That (null) is there no matter what.... I was wondering how to take it
> off.... that started happening when I took the class of the player out
> of the wholist (like imp, ava, etc) that goes right beside race.
Original code:
/*Format it up. */
sprintf( buf, "[%2d %6s %s] %s%s%s%s%s%s%s%s\n\r",
wch->level,
wch->race < MAX_PC_RACE ? pc_race_table[wch->race].who_name : " ",
class,
wch->incog_level >= LEVEL_HERO ? "(Incog) " : "",
wch->invis_level >= LEVEL_HERO ? "(Wizi) " : "",
clan_table[wch->clan].who_name,
IS_SET(wch->comm, COMM_AFK) ? "[AFK] " : "",
IS_SET(wch->act, PLR_KILLER) ? "(KILLER) " : "",
IS_SET(wch->act, PLR_THIEF) ? "(THIEF) " : "",
wch->name,
IS_NPC(wch) ? "" : wch->pcdata->title );
Your code:
sprintf (buf, "[%2d %6s %s] %s%s%s%s%s%s%s%s\n\r",
wch->level,
wch->race < MAX_PC_RACE ? pc_race_table[wch->race].who_name : " ",
wch->incog_level >= LEVEL_HERO ? "(Incog) " : "",
wch->invis_level >= LEVEL_HERO ? "(Wizi) " : "",
clan_table[wch->clan].who_name,
IS_SET (wch->comm, COMM_AFK) ? "[AFK] " : "",
IS_SET (wch->act, PLR_KILLER) ? "(KILLER) " : "",
IS_SET (wch->act, PLR_THIEF) ? "(THIEF) " : "",
wch->name,
IS_NPC (wch) ? "" : wch->pcdata->title);
You have 2 problems with the above code.
First: Even though you have removed the class, line from the sprintf you
have not removed the corresponding %s. This in effect moves the
entire body of the line over to the left one... try going incognito
to see what I mean. To fix it, remove the extra string specifier
read the man page for printf/sprintf or check your local library
for a C book if you have questions as to why this is needed.
Second: Your problem that you actually asked about: [210 Giant ] Khoren
(null)
is related to the title_table in const.c. Various functions set your
title in ROM. Advancing levels, creation of a character, and things
like
that. In this case you _might_ have added a class to the mud without
updating that table... no update means that when it queries it, it
gets
nothing back (hence the null). To fix check the code for spots that
update the title of your characters and either remove the autoset
(upon level advance) one or fix the title_table.
P.S. Tom, stuff it buddy, give some help instead of sniping at 'em if you
don't
like the answers given. and BTW, -whap- Jim was right ya fruit.
Have fun,
Steve, still coding away and hopefully learning while I do!