[Code][Errors Autoexit]

From: Adam (tornado@BLAST.NET)
Date: 09/25/97


I have been trying to make the autoexit code better than the stock stuff so
I took the ACMD(do_exits) command and basically put it into the autoexit
code, the MUD crashed everytime a regular player logged in, but an immortal
could log in fine. I have now also tried using the very similar code from
the Snippet Site.


void do_auto_exits(struct char_data *ch)
{
  int door;

  *buf = '\0';

  if (IS_AFFECTED(ch, AFF_BLIND)) {
    send_to_char("You can't see a damned thing, you're blind!\r\n", ch);
    return;
  }
  for (door = 0; door < NUM_OF_DIRS; door++) {
    if (EXIT(ch, door) && EXIT(ch, door)->to_room != NOWHERE &&
        !IS_SET(EXIT(ch, door)->exit_info, EX_CLOSED)) {
      if (GET_LEVEL(ch) >= LVL_IMMORT)
        sprintf(buf2, "%-5s - [%5d] %s\r\n", dirs[door],
                world[EXIT(ch, door)->to_room].number,
                world[EXIT(ch, door)->to_room].name);
      else {
        sprintf(buf2, "%-5s - ", dirs[door]);
        if (IS_DARK(EXIT(ch, door)->to_room) && !CAN_SEE_IN_DARK(ch))
          strcat(buf2, "Too dark to tell\r\n");
        else {
          strcat(buf2, world[EXIT(ch, door)->to_room].name);
          strcat(buf2, "\r\n");
        }
      }
      strcat(buf, CAP(buf2));
    } else if (EXIT(ch, door) && EXIT(ch, door)->to_room != NOWHERE &&
                IS_SET(EXIT(ch, door)->exit_info, EX_CLOSED)) {
        if (GET_LEVEL(ch) >= LVL_IMMORT) {
          sprintf(buf2, "%-5s - [%5d] %s - CLOSED", dirs[door],
                world[EXIT(ch, door)->to_room].number,
                world[EXIT(ch, door)->to_room].name);
          if (IS_SET(EXIT(ch, door)->exit_info, EX_LOCKED))
                strcat(buf2, " - LOCKED");
          if (IS_SET(EXIT(ch, door)->exit_info, EX_PICKPROOF))
                strcat(buf2, " - PICKPROOF");
          strcat(buf2, "\r\n");
        } else
          sprintf(buf2, "%-5s - The %s is closed\r\n", dirs[door],
                fname(EXIT(ch, door)->keyword));
      strcat(buf, CAP(buf2));
    }
  }
  send_to_char("Obvious exits:\r\n", ch);

  if (*buf)
    send_to_char(buf, ch);
  else
    send_to_char(" None.\r\n", ch);
}

I get this error message and the MUD crashes:

Thu Sep 25 22:02:36 :: SYSERR: Illegal value(s) passed to char_to_room

Could someone help me figure this out? Has anybody else had this problem.

Thanks,

Adam


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



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