--- deliantra/server/common/readable.C 2009/11/06 13:03:34 1.51 +++ deliantra/server/common/readable.C 2010/04/11 00:34:05 1.57 @@ -1,9 +1,9 @@ /* * This file is part of Deliantra, the Roguelike Realtime MMORPG. * - * Copyright (©) 2005,2006,2007,2008,2009 Marc Alexander Lehmann / Robin Redeker / the Deliantra team - * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team - * Copyright (©) 1992,2007 Frank Tore Johansen + * Copyright (©) 2005,2006,2007,2008,2009,2010 Marc Alexander Lehmann / Robin Redeker / the Deliantra team + * Copyright (©) 2002 Mark Wedel & Crossfire Development Team + * Copyright (©) 1992 Frank Tore Johansen * * Deliantra is free software: you can redistribute it and/or modify it under * the terms of the Affero GNU General Public License as published by the @@ -110,20 +110,9 @@ static int nrofmon = 0, need_to_write_bookarchive = 0; - -/* this is needed to keep track of status of initialisation - * of the message file */ -static int nrofmsg = 0; - -/* first_msg is the started of the linked list of messages as read from - * the messages file - */ -static linked_char *first_msg = NULL; - /* * Spellpath information */ - static uint32 spellpathdef[NRSPELLPATHS] = { PATH_PROT, PATH_FIRE, @@ -517,7 +506,7 @@ *****************************************************************************/ static titlelist * -get_empty_booklist (void) +get_empty_booklist () { titlelist *bl = new titlelist; @@ -528,7 +517,7 @@ } static title * -get_empty_book (void) +get_empty_book () { title *t = new title; @@ -621,16 +610,6 @@ return (char *) rbuf; } -static int -book_overflow (const char *buf1, const char *buf2, int booksize) -{ - if (buf_overflow (buf1, buf2, BOOK_BUF - 2) /* 2 less so always room for trailing \n */ - || buf_overflow (buf1, buf2, booksize)) - return 1; - - return 0; -} - /***************************************************************************** * * Start of initialisation related functions. @@ -642,7 +621,7 @@ * created and updated across multiple runs of the program. */ static void -init_book_archive (void) +init_book_archive () { FILE *fp; int comp, nroftitle = 0; @@ -767,7 +746,7 @@ * all the readable information. */ void -init_readable (void) +init_readable () { static int did_this; @@ -1371,7 +1350,7 @@ tmp = object::create (); add_abilities (tmp, art->item); tmp->type = type; - SET_FLAG (tmp, FLAG_IDENTIFIED); + tmp->set_flag (FLAG_IDENTIFIED); if ((ch = describe_item (tmp, 0)) && strlen (ch) > 1) buf << "\rProperties of this artifact include:\r" << ch << "\n"; @@ -1819,53 +1798,12 @@ /***************************************************************************** * - * Cleanup routine for readble stuff. - * - *****************************************************************************/ -static void -free_all_readable (void) -{ - titlelist *tlist, *tnext; - title *title1, *titlenext; - linked_char *lmsg, *nextmsg; - objectlink *monlink, *nextmon; - - LOG (llevDebug, "freeing all book information\n"); - - for (tlist = booklist; tlist; tlist = tnext) - { - tnext = tlist->next; - - for (title1 = tlist->first_book; title1; title1 = titlenext) - { - titlenext = title1->next; - delete title1; - } - - delete tlist; - } - - for (lmsg = first_msg; lmsg; lmsg = nextmsg) - { - nextmsg = lmsg->next; - delete lmsg; - } - - for (monlink = first_mon_info; monlink; monlink = nextmon) - { - nextmon = monlink->next; - delete monlink; - } -} - -/***************************************************************************** - * * Writeback routine for updating the bookarchive. * ****************************************************************************/ /* write_book_archive() - write out the updated book archive */ void -write_book_archive (void) +write_book_archive () { FILE *fp; int index = 0;