Roomlink [by Brian Guilbault]
Snippet Posted Wednesday, August 12th @ 11:36:03 PM, by George Greer in the Zones dept.
Added Mar 5, 1997. Click the link below to read it or download it.

From: Brian Guilbault <guil9964@nova.gmi.edu>
Subject: Checking Linked Rooms

This command should work now. It's still terribly inefficient, but it
works.  Don't forget to add your calls in interpreter.c and you are all
set.

ACMD(do_roomlink)         /* Shows all exits to a given room */
  int door = 0, i = 0, room_num = 0;  {

  one_argument(argument, buf);
  room_num = real_room(atoi(buf));

  if (room_num == NOWHERE) {
    send_to_char("There is no room with that number.\r\n", ch);
    return;
  } else {
    for (i = 0; i <= top_of_world; i++) {
      for (door = 0; door < NUM_OF_DIRS; door++) {
        if (world[i].dir_option[door] &&

    world[i].dir_option[door]->to_room == room_num) {
          sprintf(buf2, "Exit %s from room %d.\r\n", dirs[door],


world[i].number);
          send_to_char(buf2, ch);
        }
      }
    }
  }
}


<< Room Affection patch [by The Arrow] | Reply | View as text | Flattened | Roomlink (Another) [by Angus Mezick] >>

 


Related Links
  download
Related Articles
More by greerga
 
 

CircleMUD Snippets
 
Note: Not all of these snippets will work perfectly with your version of code, so be prepared to fix one or two bugs that may arise, and please let me know what you needed to do to fix it. Sending a corrected version is always welcome.
Finally, if you wish to use any of the snippets from this page, you are more than welcome, just mention the authors in your credits. If you wish to release any of these snippets to the public on another site, contact me FIRST.