Re: C struct question

From: Patrick Dughi (dughi@imaxx.net)
Date: 08/23/00


> Ok... that wouldn't work for my purposes I don't think...  perhaps time to
> get more specific.  The thing is I've added a second set of exits, only
> using a linked list of pointers rather than an array like the nomral
> exits.  So right now I'm modifying the do_doorcmd function to be compatible
> with both sets of exits.  I'm trying to do this by passing in just a
> pointer to the exit that needs to be modified.  However, the original code
> goes through this:
>
> if (!obj && ((other_room = door->to_room) != NOWHERE))
>     if ((back = world[other_room].dir_option[rev_dir[door]]) != NULL)
>       if (back->to_room != ch->in_room)
>   back = 0;
>
>
> So I have to find out the back pointer without benefit of using rev_dir...
> I'd hoped there was a away to just get a pointer to the room from the
> exit.. err... I dunno... anyone have any ideas?

3 words;
        Doubly-linked list.

                                                PjD


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