[CODE] Help! Question about rdig for Oasis

From: Tony Robbins (tonyr@NWPACLINK.COM)
Date: 06/30/98


I've just about finished porting the do_copyto and do_dig from the
snippet site to my liking.  Now copyto will copy a room or an object,
and dig will create and destroy exits.

But I don't feel I'm done yet, and I'm having problems.  I can't even
figure out how to paste the code into Nutscrape.  :P

Anyway, by hand, here goes:

/* partially violently torn from obuild.08 , i miss obuild  :( */
for (i = (save_zone * 100); i <= (save_zone * 100) + 99; i++) {

  /* if it don't exist... */
  if (real_room(i) < 0) {
    top_of_world++; /* make the world bigger */
    world[top_of_world].zone = save_zone;
    world[top_of_world].number = i;
    world[top_of_world].contents = NULL;
    world[top_of_world].people = NULL;
    world[top_of_world].light = 0;
    world[top_of_world].ex_description = NULL;
    world[top_of_world].name = str_dup("A new room");
    world[top_of_world].description = str_dup("You are in a room.\r\n");
    world[top_of_world].room_flags = 0;
    world[top_of_world].sector_type = 0;

    for (j = 0;j < NUM_OF_DIRS;j++)
      world[top_of_world].dir_option[j] = NULL;

    sprintf(buf, "Created new room #%i.\r\n", i);
    send_to_char(buf, ch);
    break;
  }
}


It then later on assigns the real_room() of i to the to_room of the
direction the person specified.
(world[IN_ROOM(ch)].dir_option[dir]->to_room = real_room(i);)

The problem is, it creates an exit to -1 apparently.  This does nothing,
and apparently this means that all of that above code did nothing.  I am
trying to make this work like
rset exit <dir> <(dis)connect> <1|2> does in obuild, e.g., it creates a
new room if you don't specify a room number.  Can somebody help me as to
how to make it add a room?  I don't want to do what
redit_save_internally does with rooms and was hoping I could just put
the room at the top_of_world and have everything be jolly.

I don't want to do CREATE(new_world;struct room_data;top_of_world + 2);


Uggh, I'm tired, and tomorrow's my birthday.  :P  Help!


     +------------------------------------------------------------+
     | 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/15/00 PST