ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/readable.C
(Generate patch)

Comparing deliantra/server/common/readable.C (file contents):
Revision 1.6 by root, Wed Sep 13 23:32:04 2006 UTC vs.
Revision 1.10 by root, Fri Sep 29 21:55:54 2006 UTC

1
2/*
3 * static char *rcsid_readable_c =
4 * "$Id: readable.C,v 1.6 2006/09/13 23:32:04 root Exp $";
5 */
6
7/* 1/*
8 CrossFire, A Multiplayer game for X-windows 2 CrossFire, A Multiplayer game for X-windows
9 3
10 Copyright (C) 2002 Mark Wedel & Crossfire Development Team 4 Copyright (C) 2002 Mark Wedel & Crossfire Development Team
11 Copyright (C) 1992 Frank Tore Johansen 5 Copyright (C) 1992 Frank Tore Johansen
22 16
23 You should have received a copy of the GNU General Public License 17 You should have received a copy of the GNU General Public License
24 along with this program; if not, write to the Free Software 18 along with this program; if not, write to the Free Software
25 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 20
27 The authors can be reached via e-mail at crossfire-devel@real-time.com 21 The authors can be reached via e-mail at <crossfire@schmorp.de>
28*/ 22*/
29 23
30 24
31/* This file contains code relevant to the BOOKS hack -- designed 25/* This file contains code relevant to the BOOKS hack -- designed
32 * to allow randomly occuring messages in non-magical texts. 26 * to allow randomly occuring messages in non-magical texts.
1617 archetype *at; 1611 archetype *at;
1618 1612
1619 /* preamble */ 1613 /* preamble */
1620 sprintf (retbuf, "Herein is described a project using %s: \n", formula->skill ? &formula->skill : "an unknown skill"); 1614 sprintf (retbuf, "Herein is described a project using %s: \n", formula->skill ? &formula->skill : "an unknown skill");
1621 1615
1622 if ((at = find_archetype (op_name)) != (archetype *) NULL) 1616 if ((at = archetype::find (op_name)) != (archetype *) NULL)
1623 op_name = at->clone.name; 1617 op_name = at->clone.name;
1624 else 1618 else
1625 LOG (llevError, "formula_msg() can't find arch %s for formula.\n", op_name); 1619 LOG (llevError, "formula_msg() can't find arch %s for formula.\n", op_name);
1626 1620
1627 /* item name */ 1621 /* item name */
1656 if (formula->ingred != NULL) 1650 if (formula->ingred != NULL)
1657 { 1651 {
1658 linked_char *next; 1652 linked_char *next;
1659 archetype *at; 1653 archetype *at;
1660 1654
1661 at = find_archetype (formula->cauldron); 1655 at = archetype::find (formula->cauldron);
1662 1656
1663 sprintf (retbuf + strlen (retbuf), 1657 sprintf (retbuf + strlen (retbuf),
1664 " may be made at %s using the following ingredients:\n", at ? query_name (&at->clone) : "an unknown place"); 1658 " may be made at %s using the following ingredients:\n", at ? query_name (&at->clone) : "an unknown place");
1665 1659
1666 for (next = formula->ingred; next != NULL; next = next->next) 1660 for (next = formula->ingred; next != NULL; next = next->next)
1984 strcpy (msgbuf, msgfile_msg (level, book_buf_size)); 1978 strcpy (msgbuf, msgfile_msg (level, book_buf_size));
1985 break; 1979 break;
1986 } 1980 }
1987 1981
1988 strcat (msgbuf, "\n"); /* safety -- we get ugly map saves/crashes w/o this */ 1982 strcat (msgbuf, "\n"); /* safety -- we get ugly map saves/crashes w/o this */
1983
1989 if (strlen (msgbuf) > 1) 1984 if (strlen (msgbuf) > 1)
1990 { 1985 {
1991 book->msg = msgbuf; 1986 book->msg = msgbuf;
1992 /* lets give the "book" a new name, which may be a compound word */ 1987 /* lets give the "book" a new name, which may be a compound word */
1993 change_book (book, msg_type); 1988 change_book (book, msg_type);
2022 delete title1; 2017 delete title1;
2023 } 2018 }
2024 2019
2025 delete tlist; 2020 delete tlist;
2026 } 2021 }
2022
2027 for (lmsg = first_msg; lmsg; lmsg = nextmsg) 2023 for (lmsg = first_msg; lmsg; lmsg = nextmsg)
2028 { 2024 {
2029 nextmsg = lmsg->next; 2025 nextmsg = lmsg->next;
2030 delete lmsg; 2026 delete lmsg;
2031 } 2027 }
2028
2032 for (monlink = first_mon_info; monlink; monlink = nextmon) 2029 for (monlink = first_mon_info; monlink; monlink = nextmon)
2033 { 2030 {
2034 nextmon = monlink->next; 2031 nextmon = monlink->next;
2035 free (monlink); 2032 free (monlink);
2036 } 2033 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines