[DG-SCRIPT] Crashing when adding new rooms

From: Erik Einebaerholm (bushy@online.no)
Date: 08/11/00


Hola,

Some time ago Serces wrote:
> The code around where the crash occurs is:
> File: dg_scripts.c
> Function: int script_driver(void *go, trig_data *trig,
> int type, int mode)
>      case WLD_TRIGGER:
>        if (!(sc = SCRIPT((struct room_data *) go))) {
>          sprintf(buf,"SYSERR:No room(%d)->script in script_driver",
>                     ((struct room_data *) go)->number);
>          mudlog(buf,DEB,LVL_IMMORT,TRUE);
>          return FALSE;
>        }
>      break;

This occurs when a trigger is in wait-state (i.e. wait 20s) and
someone adding a new room.. That makes the rooms rebuild,
memory and all..  the wait ends and gets *go from wait_event_obj,
which means a pointer to the old address of the (in this case
room_data) structure..  which is the reason I think it crashes
while looking for go->script..

Now, the solutions might be up for discussion..
What I did to try fixing it is to add the vnum for wld/mob/obj in
the wait_event_obj, and on the end of waits I set *go to point
to the right location in the memory..  this demands some
cpu-processing to locate the world which has that specific
vnum.. (first find the rnum, then point it to the location that has it)

I'm wondering if there are some other easier solutions, as like
whenever you reset the worldfile after a new room is added,
one could solve this with going through the waiting triggers, and
set *go to the right position..

Any ideas/thoughts on how to solve it in the best way ?

Regards,
Erik,


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