Re: OLC Redit Fix

From: nate (wintersn.geo@yahoo.com)
Date: 11/09/00


>Check the archives :)  This came up a long time ago, I did mailed a patch
for
>when the room was placed back into the world table the pointers to people
>were saved off and placed into the new room.

>Chris


Thanks for the help chris. Took a little searching to find it, but here it
is for anyone using Oasis 2.0.

http://post.queensu.ca/cgi-bin/listserv/wa?A2=ind9907&L=circle&P=R1769


and, another fix that zemial found that was crashing us every time a new
room is made, the problem was first pointed out a while ago in this message:

http://post.queensu.ca/cgi-bin/listserv/wa?A2=ind0005&L=circle&D=0&P=38049

but no solution was given. So this is what The Builder's Academy head coder
Zemial did to fix it. This applies to those using dg scripts only.


In genwld.c
In function add_room:

if ((i = real_room(room->number)) != NOWHERE) {
    tch = world[i].people;
    tobj = world[i].contents;
    copy_room(&world[i], room);
    world[i].people = tch;
    world[i].contents = tobj;
    add_to_save_list(zone_table[room->zone].number, SL_WLD);
    log("GenOLC: add_room: Updated existing room #%d.", room->number);
--  assign_triggers(&world[i], WLD_TRIGGER);
    return i;
  }



/*
   * Update world exits. ++ & Triggers
   */
  for (i = top_of_world; i >= 0; i--) ++ {
++    // EXITS
    for (j = 0; j < NUM_OF_DIRS; j++)
      if (W_EXIT(i, j))
        W_EXIT(i, j)->to_room += (W_EXIT(i, j)->to_room >= found);
++    // TRIGGERS
++      if(SCRIPT(&world[i])) {
++        extract_script(SCRIPT(&world[i]));
++        SCRIPT(&world[i]) = NULL;
++      }
++      assign_triggers(&world[i], WLD_TRIGGER);
++  }
  add_to_save_list(zone_table[room->zone].number, SL_WLD);


If the triggers somehow should mess up, catch null reference in dg_scripts.c
In function: find_replacement

/* X.global() will have a NULL trig */
  if (trig)
    for (vd = GET_TRIG_VARS(trig); vd; vd = vd->next)
      if (!str_cmp(vd->name, var))
        break;

++  /* CRASH on new room safeguard */
++  if (sc == NULL) {
++    mudlog("SYSERR: OLC: Error referencing script - NULL POINTER
detected.", CMP, LVL_BUILDER, TRUE);
++    return;
++  }

  if (!vd)
    for (vd = sc->global_vars; vd; vd = vd->next)
      if (!str_cmp(vd->name, var) && (vd->context==0 ||
vd->context==sc->context))
        break;


Hope this helps some people.

Second hand post by,


Rumble

The Builder's Academy
cruelworld.dune.net  Port: 9091


__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com


     +------------------------------------------------------------+
     | 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/11/01 PDT