--- deliantra/server/common/readable.C 2006/09/10 16:00:23 1.5 +++ deliantra/server/common/readable.C 2006/09/13 23:32:04 1.6 @@ -1,7 +1,7 @@ /* * static char *rcsid_readable_c = - * "$Id: readable.C,v 1.5 2006/09/10 16:00:23 root Exp $"; + * "$Id: readable.C,v 1.6 2006/09/13 23:32:04 root Exp $"; */ /* @@ -82,7 +82,7 @@ */ /* 'title' and 'titlelist' are used by the readable code */ -typedef struct titlestruct:zero_initialised +struct title : zero_initialised { shstr name; /* the name of the book */ shstr authour; /* the name of the book authour */ @@ -90,25 +90,22 @@ int level; /* level of difficulty of this message */ int size; /* size of the book message */ int msg_index; /* an index value derived from book message */ - struct titlestruct *next; -} title; + title *next; +}; -typedef struct titleliststruct:zero_initialised +struct titlelist : zero_initialised { int number; /* number of items in the list */ - struct titlestruct *first_book; /* pointer to first book in this list */ - struct titleliststruct *next; /* pointer to next book list */ -} titlelist; + title *first_book; /* pointer to first book in this list */ + titlelist *next; /* pointer to next book list */ +}; /* special structure, used only by art_name_array[] */ - -typedef struct namebytype +struct arttypename { const char *name; /* generic name to call artifacts of this type */ int type; /* matching type */ -} -arttypename; - +}; /* booklist is the buffer of books read in from the bookarch file */ static titlelist *booklist = NULL; @@ -567,6 +564,7 @@ { if (!tl->next) tl->next = get_empty_booklist (); + tl = tl->next; number--; } @@ -735,6 +733,7 @@ if (did_init_barch) return; + did_init_barch = 1; if (!booklist) @@ -893,6 +892,7 @@ if (tl) t = tl->first_book; + while (t) if (t->size == length && t->msg_index == index) break;