Re: dg scripts and bpl17

From: Jason Beeland (jbeeland@bellsouth.net)
Date: 07/29/00


Ok, I didn't bother putting any quoted text in here
because I don't really think it's needed at this point
in the thread.  To make a long story short I have made
a patch which gets rid of most of the olc stuff in the
dg_7_with_oasis_patch.  It's not really clean, but i'm
patching it into my real code now.  The down side here
is that the dgscripts are of course for oasis 1.5, and
I use 2.0.  I have gotten almost everything patched in
without a huge amount of issues, though it was a lot
of hand patching.  I have one question though.  In the
oasis 1.5 dg script code there are things added to the
Xedit_save_internal function where it attaches stuff
to the prototypes (i think) but in the 2.0 oasis this
code is all totally different.  I was wondering if one
of you dg/oasis guru's out there might have a tip for
hand patching this.  I'll include the snips below.

Sorry for the long snips, but I'm rather stuck here.
If anyone needs a little more of the code to look at
just drop me a mail.  If anyone would like the patch
I generated or info about it lemme know also.  Warning
on the patch though, it's prolly not the cleanest patch
ever made so use at your own risk.  And if anyone wants
to clean the patch up, of course feel free. :)

Thanks,
Jason Beeland

dg+olc 1.5 save segment:

*** 164,169 ****
      OLC_ROOM(d)->people = world[room_num].people;
      free_room(world + room_num);
      world[room_num] = *OLC_ROOM(d);
    } else {                    /* Room doesn't exist, hafta add it. */
      CREATE(new_world, struct room_data, top_of_world + 2);

--- 184,190 ----
      OLC_ROOM(d)->people = world[room_num].people;
      free_room(world + room_num);
      world[room_num] = *OLC_ROOM(d);
+     world[room_num].proto_script = OLC_SCRIPT(d);
    } else {                    /* Room doesn't exist, hafta add it. */
      CREATE(new_world, struct room_data, top_of_world + 2);

and ehre is the coorosponding funct in oasis 2.0

void redit_save_internally(struct descriptor_data *d)
{
  int j, room_num, new_room = FALSE;
  struct descriptor_data *dsc;

  if (OLC_ROOM(d)->number == NOWHERE) {
    new_room = TRUE;
    OLC_ROOM(d)->number = OLC_NUM(d);
  }
  /* FIXME: Why is this not set elsewhere? */
  OLC_ROOM(d)->zone = OLC_ZNUM(d);

  if ((room_num = add_room(OLC_ROOM(d))) < 0) {
    SEND_TO_Q("Something went wrong...\r\n", d);
    log("SYSERR: redit_save_internally: Something failed! (%d)", room_num);
    return;
  }

  /* Don't adjust numbers on a room update. */
  if (!new_room)
    return;

  /* Idea contributed by C.Raehl 4/27/99 */
  for (dsc = descriptor_list; dsc; dsc = dsc->next) {
    if (dsc == d)
      continue;

    if (STATE(dsc) == CON_ZEDIT) {
      for (j = 0; OLC_ZONE(dsc)->cmd[j].command != 'S'; j++)
        switch (OLC_ZONE(dsc)->cmd[j].command) {
          case 'O':
          case 'M':
            OLC_ZONE(dsc)->cmd[j].arg3 += (OLC_ZONE(dsc)->cmd[j].arg3 >= room_num);
            break;
          case 'D':
            OLC_ZONE(dsc)->cmd[j].arg2 += (OLC_ZONE(dsc)->cmd[j].arg2 >= room_num);
            /* Fall through */
          case 'R':
            OLC_ZONE(dsc)->cmd[j].arg1 += (OLC_ZONE(dsc)->cmd[j].arg1 >= room_num);
            break;
          }
    } else if (STATE(dsc) == CON_REDIT) {
      for (j = 0; j < NUM_OF_DIRS; j++)
        if (OLC_ROOM(dsc)->dir_option[j])
          if (OLC_ROOM(dsc)->dir_option[j]->to_room >= room_num)
            OLC_ROOM(dsc)->dir_option[j]->to_room++;
    }
  }
}


----------------------------------------------------------------------------
Access your e-mail anywhere, at any time.
Get your FREE BellSouth Web Mail account today!
http://webmail.bellsouth.net
----------------------------------------------------------------------------


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



This archive was generated by hypermail 2b30 : 04/10/01 PDT