Re: NEWBIE: bug in "who"

From: Michael Buselli (m-buselli@uchicago.edu)
Date: 05/16/96


zero@baker.cnw.com wrote:

[snip]
> I thought the mud may be logging a character in more than once for some 
> reason but users shows the characters fine.  I now assume it is something 
> wrong with the loop that lists characters in do_who but i didnt change 
> the loop directly (i did change it so it would list the levels for all a  
> characters classes).  Here is my do_who, can some please tell me what i 
> messed up?
[snip]
>     if (short_list) {
>       sprintf(buf, "%s[%2d %2d %2d %2d %2d] %-12.12s%s%s",
>         IC),
>           GET_LEVELX(tch, CLASS_THIEF), GET_LEVELX(tch, CLASS_WARRIOR),
>           GET_LEVELX(tch, CLASS_BARD), GET_NAME(tch),
>           (GET_LEVEL(tch) >= LVL_IMMORT ? CCNRM(ch, C_SPR) : ""),
>           ((!(++num_can_see % 4)) ? "\r\n" : ""));
>       send_to_char(buf, ch);
>     } else {
>       num_can_see++;
>       sprintf(buf, "%s[%2d %2d %2d %2d %2d] %s %s", buf,
                      ^^                              ^^^^
Change this line to:

        sprintf(buf, "[%2d %2d %2d %2d %2d] %s %s",

>             GET_LEVELX(tch, CLASS_MAGIC_USER), GET_LEVELX(tch, CLASS_CLERIC),
>             GET_LEVELX(tch, CLASS_THIEF), GET_LEVELX(tch, CLASS_WARRIOR),
>             GET_LEVELX(tch, CLASS_BARD), GET_NAME(tch),
>             GET_TITLE(tch));
> 
>       if (GET_INVIS_LEV(tch))
>         sprintf(buf, "%s (i%d)", buf, GET_INVIS_LEV(tch));
>       else if (IS_AFFECTED(tch, AFF_INVISIBLE))
>         strcat(buf, " (invis)");
[snip]

     Do ya get it? :)

--
Michael Buselli
m-buselli@uchicago.edu
http://student-www.uchicago.edu/users/mhbusell/



This archive was generated by hypermail 2b30 : 12/18/00 PST