Re: [CODE HELP] Interpreter.c/Autoequip problem

From: Stephen Arnold (dalamar@CYBERCOM.NET)
Date: 07/31/97


On Wed, 30 Jul 1997, Patrick J. Dughi wrote:

> >
> >       if (load_room == NOWHERE) {
> >         if (GET_LEVEL(d->character) >= LVL_IMMORT)
> >           load_room = r_immort_start_room;
> >         else
> >           load_room = r_mortal_start_room;
> >       }
> >
> >       if (PLR_FLAGGED(d->character, PLR_FROZEN))
> >         load_room = r_frozen_start_room;
> >
> >         Ok, as it is set up currently, i offset the LOADROOM code and made
> > everyone have a loadroom of NOWHERE to prevent that autoequip error. That
> > last part in my file that is in comments is the code that other circle
> > listings said what to do in replace of the line:
> >     if ((load_result = Crash_load(d->character)))
> >         However, this will cause a Memory fault when I reboot and someone
> > punches in there name. What am I doing wrong?
>
>         The only thing I can think of, since this is identical to my
> working code (well, mostly.. minus some afk, and other stuff...)
>         Do the rooms r_immortal_start_room, r_mortal_start_room exist? I
> thought that if they didn't, that you'd auto-load in the void, or
> something along that line, but otherwise, you MAY be char_to_room()ing
> when the specified room does not exist.....
>
>         I don't think that the error exists specifically in this function,
> but either the global vars, or the functions which come after... possibly
> the "save_char" call, which has to set the load room.... and if they're
> still in limbo when the save_Char is called.. bang..... save with a room
> when their "in_room" isn't set yet..
>
>                                         PjD
        How would it not exist? in config.c I believe, it has lines that
says Immort_start_room = 1204, mort_start_room = 3001. And when I negate
the load_room code with the load_room = NOWHERE at the top of 1 in
interpreter.c, everything works ok (though oviously everyone loads in
their respective ?_start_rooms.
        This is how I am deciphering the code:
if ((load_room = GET_LOADROOM(d->character)) != NOWHERE)
load_room = real_room(GET_LOADROOM(d->character));
        Ok, this is looking to see if the rnum of LOADROOM is actually in
the world, if it is, converts it to its vnum, otherwise, load_room is
assigned NOWHERE.
        Next it goes to assigning it either immort_start_room or
mort_start_room, if load_room is NOWHERE
        Now, the next part is what is confusing me. What exactly is the
line if (load_result = Crash_load(d->character)) doing? I am not that
eperienced and have not gone through all the functions to see what they
are doing, so this one remains a mystery.
        SO, my code goes:
        char_to_room(d->character, load_room);
        if (load_result = Crash_load(d->character))
        if <U R MORT, U R NOT FROZEN> {
           char_from_room(d->character)
           char_to_room(d->character, load_room)
           }

        Exactly what is the above doing? why does it send you to a room,
pull you into Nowhere, and then put you back?


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