Re: [newbie] arena.txt

From: George Greer (greerga@circlemud.org)
Date: 06/23/02


On Sun, 23 Jun 2002, Peter d wrote:

>for (d = descriptor_list; d; d = d->next)
>    if (!d->connected) {

        STATE(d) == CON_PLAYING

>            ROOM_FLAGGED(IN_ROOM(tch), ROOM_ARENA) &&
>            (tch->in_room != NOWHERE) && GET_LEVEL(tch)<LVL_IMMORT) {

The order of the first two checks is backwards.

>          sprintf(buf , "%s%-20.20s%s", buf,
>          GET_NAME(tch),(!(++num % 3) ? "\r\n" : ""));

The "sprintf(buf, "%s...", buf, ...)" idiom doesn't work on all systems.
Borland's sprintf() is the only one I know that it doesn't.  Yours doesn't
appear to work with it either.

>this piece of code is located just below.. and it is this code that only
>prints out the first arena fighter, but none of the others..
>this should be the last thing for now with the arena.. thanx for your time.

Change all of your:

  sprintf(buf, "%s...", buf, ...);

to:

  int len = 0;  // (at the top, obviously)

  len += sprintf(buf + len, "...", ...)

and pray your 'buf' is big enough.

--
George Greer
greerga@circlemud.org

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT