Error in Room Dig-like Command

From: Jory Graham (
Date: 08/18/01

I made an "outworld" of sorts for my mud using the ascii mapping system
snippet a few months ago. Since then, I made a ~2000 room map by hand.  I
upgraded my bpl14 to 18, and added in the extra exits. I didn't want to have
to manually do all the extra exits for the outworld, so I wrote a nice little
command that i had hoped would just toss them in there.  I based it off the
do_dig snippet, and visually it seemed to work fine.  I made a dummy area of
20 rooms, and tested it on the middle ones (so there were valid exits in all
4 standard directions). It made all the exits to the appropiate rooms, but
now if i try to enter, goto, or in anyway get to one of those rooms, the mud
crashes.  This code isn't beautiful, but as far as i can tell, workable.  Any
ideas?  Thanks in advance.

ACMD(do_addextras) {

/* Only works if you have Oasis OLC */

  int i, dir1 = 0, dir2 = 0, dir3 = 0, rroom = 0;

  /* Main stuff */
for (i = 0;i<4;i++) {
    switch (i) {
    case 0:
        dir1 = NORTHEAST;
        dir2 = NORTH;
        dir3 = EAST;
    case 1:
        dir1 = SOUTHEAST;
        dir2 = EAST;
        dir3 = SOUTH;
    case 2:
        dir1 = SOUTHWEST;
        dir2 = SOUTH;
        dir3 = WEST;
    case 3:
        dir1 = NORTHWEST;
        dir2 = NORTH;
        dir3 = WEST;
        log("CRAP! do_addextras is broken!");
    rroom =
    CREATE(world[rroom].dir_option[rev_dir[dir1]], struct
    world[rroom].dir_option[rev_dir[dir1]]->general_description = NULL;
    world[rroom].dir_option[rev_dir[dir1]]->keyword = NULL;
    world[rroom].dir_option[rev_dir[dir1]]->to_room = ch->in_room;
    CREATE(world[ch->in_room].dir_option[dir1], struct room_direction_data,1);
    world[ch->in_room].dir_option[dir1]->general_description = NULL;
    world[ch->in_room].dir_option[dir1]->keyword = NULL;
    world[ch->in_room].dir_option[dir1]->to_room = rroom;

/* Only works if you have Oasis OLC */


 sprintf(buf, "You add extra exits to room %d.\r\n", ch->in_room);
 send_to_char(buf, ch);

Jory Graham

   | FAQ: |
   | Archives: |

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