Re: OLC Redit Fix

From: nate (
Date: 11/09/00

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


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

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:

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

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

++  /* 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 ||

Hope this helps some people.

Second hand post by,


The Builder's Academy  Port: 9091

Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  |

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