Autoexits problem

From: Ben Merton (ben@adventec.com.au)
Date: 09/07/02


Hey all :)

Having some problems with autoexit, was hoping you guys could help. I'm
running circle30bpl19, ascii pfiles, olc etc..

The problem: just say for arguments sake that you have exits to the north,
east and south... it will be displayed as:

Exits: North, East, South.

However if you have exits to the east and west, it will be displayed as:

Exits: East West.

The comma between east and west is gone... I have attached the related code
below so you can see what I'm talking about..

It is my belief that in the case of "east west" it is running sprintf(buf,
"%s &c%s", buf, capdirs[door]); instead of sprintf(buf, "%s,", buf); but i
cant see why this is occuring.

Any assistance on this matter would be greatly appreciated, if there is any
further information I can provide please contact me.

Thanks, Ben

-- SNIPPET --
const char *capdirs[] = {
  "North",
  "East",
  "South",
  "West",
  "Up",
  "Down",
  "\n"
};

void do_auto_exits(struct char_data * ch)
{
  int door;
  bool flag = FALSE;

  *buf = '\0';

  for (door = 0; door < NUM_OF_DIRS; door++)
      if (EXIT(ch, door) && EXIT(ch, door)->to_room != NOWHERE) {
        if (flag) {
                sprintf(buf, "%s,", buf);
                }
                flag = TRUE;
        if (IS_SET(EXIT(ch, door)->exit_info, EX_CLOSED)) {
          sprintf(buf, "%s &c%s(Closed)", buf, capdirs[door]);
        } else {
          sprintf(buf, "%s &c%s", buf, capdirs[door]);
        }
      } else {
          flag = FALSE;
          }
  sprintf(buf2, "&cExits:%s.&n\r\n", ((*buf) ? buf : "&c None"));

-- END SNIPPET --

--
   +---------------------------------------------------------------+
   | 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