[CODE] SYSERR:

From: flawed (flawed@io.com)
Date: 09/23/01


Hope someone can give me a hand with this.  When I goto dig a room, it
creates a new room if one does not exist.  The room digs correctly, but I
get the following syserror and I'm not sure what exactly needs to be fixed.


Sep 23 01:59:52 :: GenOLC: add_room: Added room 1292 at index #14.
Sep 23 01:59:52 :: SYSERR: add_to_save_list: Invalid zone number passed.
(25956 => -1, 0-3)
Sep 23 01:59:52 :: SYSERR: GenOLC: save_rooms: Invalid zone number 12 passed! (0-3)
Sep 23 01:59:52 :: OLC: Matt dug an exit northwest from room 1291 to room 1292

Heres the dig command I use incase it helps:

ACMD(do_dig)
{
/* Only works if you have Oasis OLC */
extern int add_to_save_list(zone_vnum zone, int type);

  char buf3[MAX_INPUT_LENGTH];
  int iroom = 0, rroom = 0;
  int dir = 0;
  int i;
  struct room_data * temp_room;
  /* struct room_data *room; */

  any_one_arg(any_one_arg(argument, buf2), buf3);
  /* buf2 is the direction, buf3 is the room */
  iroom = atoi(buf3);
  rroom = real_room(iroom);

  if (!*buf3) {
    send_to_char("Format: dig <dir> <room number>\r\n", ch);
    return; }

  if (rroom <= 0)
 {
  for(i = 0; i < top_of_zone_table; i++)
          if(zone_table[i].number == (iroom/100))
          break;

  if(i == top_of_zone_table)
   {
      send_to_char("The zone does not exist.\r\n", ch);
      return;
   }

   CREATE(temp_room, struct room_data, 1);
   temp_room->name = str_dup("An unfinished room");
   temp_room->description = str_dup("You are in an unfinished room.\r\n");
   temp_room->number = iroom;
   temp_room->zone = iroom/100;
   rroom = add_room(temp_room);
   free(temp_room->name);
   free(temp_room->description);
   free(temp_room);
   }

  /*
   * Everyone but IMPLs can only edit zones they have been assigned.
   */
  if ((GET_LEVEL(ch) < LVL_IMPL) && (world[rroom].zone != GET_OLC_ZONE(ch)
||
       world[IN_ROOM(ch)].zone != GET_OLC_ZONE(ch))) {
    send_to_char("You do not have permission to edit this zone.\r\n", ch);
    return;
  }

/* Main stuff */
  if ((dir = search_block(buf2, dirs, FALSE)) == -1)
    if ((dir = search_block(buf2, abbr_dirs, FALSE)) == -1) {
      sprintf(buf, "Invalid direction %s.", buf2);
      send_to_char(buf, ch);
      return;
    }
  if (!world[rroom].dir_option[rev_dir[dir]]) /* If statement to patch up
                                                 apparent memory leak */
    CREATE(world[rroom].dir_option[rev_dir[dir]], struct room_direction_data,1);
  world[rroom].dir_option[rev_dir[dir]]->general_description = NULL;
  world[rroom].dir_option[rev_dir[dir]]->keyword = NULL;
  world[rroom].dir_option[rev_dir[dir]]->to_room = ch->in_room;

  if (!world[ch->in_room].dir_option[dir]) /* If statement to patch up
                                                apparent memory leak */
    CREATE(world[ch->in_room].dir_option[dir], struct room_direction_data,1);
  world[ch->in_room].dir_option[dir]->general_description = NULL;
  world[ch->in_room].dir_option[dir]->keyword = NULL;
  world[ch->in_room].dir_option[dir]->to_room = rroom;

  /* Only works if you have Oasis OLC */
  add_to_save_list((iroom/100), SL_WLD);
  redit_save_to_disk(iroom/100);

  sprintf(buf, "You make an exit %s to room %d.\r\n", dirs[dir], iroom);
  send_to_char(buf, ch);
  sprintf(buf, "OLC: %s dug an exit %s from room %d to room %d", GET_NAME(ch),
          dirs[dir], world[IN_ROOM(ch)].number, iroom);
  mudlog(buf, CMP, LVL_IMMORT, TRUE);
}

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/06/01 PST