Hello: OK, so I got tired of having to retype the same lines of code every time I wanted to show someone's appearance, so I coded a bit and came up with this:
char *appearance_string(CHAR_DATA *ch) { int app; char *tmp; CHAR_DATA *wch;
app = get_curr_stat(wch, STAT_APP); if (app == 0) tmp = "Hideous"; else if (app == 1) tmp = "Ugly"; else if (app == 2) tmp = "Plain"; else if (app == 3) tmp = "Average"; else if (app == 4) tmp = "Attractive"; else tmp = "Radiant";
OK, so I got tired of having to retype the same lines of code every time I wanted to show someone's appearance, so I coded a bit and came up with this:
It is then called in my who function like this:
sprintf( buf, "{R[{Y%s %6s{R]{x %s%s%s%s%s\n\r%s{R%s{x%s{R%s{x\n\r",appearance_string(wch),
wch->sex == 0 ? "Sexless" : wch->sex == 1 ? "Male" : "Female",
IS_SET(wch->act2, ACT2_STORY) ? "{R[{YST{R]{x": "",
IS_SET(wch->comm, COMM_AFK) ? "{R[{YAFK{R]{x": "",
wch->name,
wch->surname[0] != '\0' ? " ":"",
wch->surname,
" ", /* golden tule spacing */
fRPOK ? " [": "",
IS_NPC(wch) ? "" : !fRPOK ? wch->pcdata->title : wch->pcdata->rpok_string,
fRPOK ? "]": "");
But then whenever I use the who command, it crashes. Any thoughts? Thanks in advance.
Arholly