Re: Usage of obj->next and obj->next_content

From: Dan Merillat (harik@chaos.ao.net)
Date: 02/20/00


Ben Cartwright writes:
> > Arn't those two redundant?  From my checking, you can have
> >
> > Person.inventory object->next->next->next
> >                     \      \-contains->next
> >                      \->contains->next->next->next
> >                                     \->contains
> >
> > without ever needing the next_content.  Is that just around for historical
> > reasons?  I'm attempting to simplify somewhat and redo the load/save
> routines.
> >
> > Am I totally off-base or can this be brought in-line?
> >
>
> struct obj_data {
>    <...>
>    struct obj_data *next_content; /* For 'contains' lists             */
>    struct obj_data *next;         /* For the object list              */
> };
>
>     Actually, unless I am mistaken, the next pointer is used soley for the
> global linked list of objects, and is not referenced at all when you are
> moving objects around.  next_content is used in separate linked lists,
> headed by either room_data.contents, char_data.carrying, or
> obj_data.contains.
>     For verification, you can just dig through handler.c, which contains all
> the linked-list management functions.

Ahh!  Gotcha.  That makes more sense, I was looking at it backwards.

Handler.c is probably something I'm gonna need to print and sit at with a
pencil and hilighter.  :-)

a few readings of it should clear out the cowebs here.

--Dan


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