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.40 by root, Thu Jan 1 11:41:17 2009 UTC vs.
Revision 1.42 by sf-marcmagus, Thu Oct 15 16:00:37 2009 UTC

3 * 3 *
4 * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team 4 * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
5 * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team 5 * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team
6 * Copyright (©) 1992,2007 Frank Tore Johansen 6 * Copyright (©) 1992,2007 Frank Tore Johansen
7 * 7 *
8 * Deliantra is free software: you can redistribute it and/or modify 8 * Deliantra is free software: you can redistribute it and/or modify it under
9 * it under the terms of the GNU General Public License as published by 9 * the terms of the Affero GNU General Public License as published by the
10 * the Free Software Foundation, either version 3 of the License, or 10 * Free Software Foundation, either version 3 of the License, or (at your
11 * (at your option) any later version. 11 * option) any later version.
12 * 12 *
13 * This program is distributed in the hope that it will be useful, 13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details. 16 * GNU General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU General Public License 18 * You should have received a copy of the Affero GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>. 19 * and the GNU General Public License along with this program. If not, see
20 * <http://www.gnu.org/licenses/>.
20 * 21 *
21 * The authors can be reached via e-mail to <support@deliantra.net> 22 * The authors can be reached via e-mail to <support@deliantra.net>
22 */ 23 */
23 24
24/* This file contains code relevant to the BOOKS hack -- designed 25/* This file contains code relevant to the BOOKS hack -- designed
817 else 818 else
818 t = t->next; 819 t = t->next;
819 820
820#ifdef ARCHIVE_DEBUG 821#ifdef ARCHIVE_DEBUG
821 if (t) 822 if (t)
822 LOG (llevDebug, "Found title match (list %d): %s %s (%d)\n", msgtype, t->name, t->authour, t->msg_index); 823 LOG (llevDebug, "Found title match (list %d): %s %s (%d)\n", msgtype, &t->name, &t->authour, t->msg_index);
823#endif 824#endif
824 825
825 return t; 826 return t;
826} 827}
827 828
975 976
976 /* We have stuff we need to write now */ 977 /* We have stuff we need to write now */
977 need_to_write_bookarchive = 1; 978 need_to_write_bookarchive = 1;
978 979
979#ifdef ARCHIVE_DEBUG 980#ifdef ARCHIVE_DEBUG
980 LOG (llevDebug, "Archiving new title: %s %s (%d)\n", book->name, book->title, msgtype); 981 LOG (llevDebug, "Archiving new title: %s %s (%d)\n", &book->name, &book->title, msgtype);
981#endif 982#endif
982 983
983} 984}
984 985
985 986
1051 if (numb == maxnames) 1052 if (numb == maxnames)
1052 { 1053 {
1053#ifdef ARCHIVE_DEBUG 1054#ifdef ARCHIVE_DEBUG
1054 LOG (llevDebug, "titles for list %d full (%d possible).\n", msgtype, maxnames); 1055 LOG (llevDebug, "titles for list %d full (%d possible).\n", msgtype, maxnames);
1055#endif 1056#endif
1056 break;
1057 } 1057 }
1058 /* shouldnt change map-maker books */ 1058 /* shouldnt change map-maker books */
1059 else if (!book->title) 1059 else if (!book->title)
1060 do 1060 do
1061 { 1061 {
1076 */ 1076 */
1077 1077
1078 if (tries == MAX_TITLE_CHECK || numb == maxnames) 1078 if (tries == MAX_TITLE_CHECK || numb == maxnames)
1079 { /* got to check maxnames again */ 1079 { /* got to check maxnames again */
1080#ifdef ARCHIVE_DEBUG 1080#ifdef ARCHIVE_DEBUG
1081 LOG (llevDebug, "Failed to obtain unique title for %s %s (names:%d/%d)\n", book->name, book->title, numb, maxnames); 1081 LOG (llevDebug, "Failed to obtain unique title for %s %s (names:%d/%d)\n", &book->name, &book->title, numb, maxnames);
1082#endif 1082#endif
1083 /* restore old book properties here */ 1083 /* restore old book properties here */
1084 book->title = old_title; 1084 book->title = old_title;
1085 1085
1086 if (rndm (4)) 1086 if (rndm (4))
1270 /* Note that the value this returns is not based on level */ 1270 /* Note that the value this returns is not based on level */
1271 tmp = get_next_mon (tmp); 1271 tmp = get_next_mon (tmp);
1272 } 1272 }
1273 1273
1274#ifdef BOOK_MSG_DEBUG 1274#ifdef BOOK_MSG_DEBUG
1275 LOG (llevDebug, "\n mon_info_msg() created strng: %d\n", strlen (retbuf)); 1275 LOG (llevDebug, "\n mon_info_msg() created string: %d\n", strlen (retbuf));
1276 fprintf (logfile, " MADE THIS:\n%s\n", retbuf); 1276 LOG (llevDebug, " MADE THIS:\n%s\n", retbuf);
1277#endif 1277#endif
1278 1278
1279 return retbuf; 1279 return retbuf;
1280} 1280}
1281 1281
1405 art = art->next; 1405 art = art->next;
1406 book_entries--; 1406 book_entries--;
1407 } 1407 }
1408 1408
1409#ifdef BOOK_MSG_DEBUG 1409#ifdef BOOK_MSG_DEBUG
1410 LOG (llevDebug, "artifact_msg() created strng: %d\n", strlen (retbuf)); 1410 LOG (llevDebug, "artifact_msg() created string: %d\n", strlen (retbuf));
1411 fprintf (logfile, " MADE THIS:\n%s", retbuf); 1411 LOG (llevDebug, " MADE THIS:\n%s", retbuf);
1412#endif 1412#endif
1413 return retbuf; 1413 return retbuf;
1414} 1414}
1415 1415
1416/***************************************************************************** 1416/*****************************************************************************
1472 } 1472 }
1473 else 1473 else
1474 { 1474 {
1475 strcat (retbuf, "\n"); 1475 strcat (retbuf, "\n");
1476 } 1476 }
1477
1478#ifdef BOOK_MSG_DEBUG
1479 LOG (llevDebug, "spellpath_msg() created string: %d\n", strlen (retbuf));
1480 LOG (llevDebug, " MADE THIS:\n%s", retbuf);
1481#endif
1477 return retbuf; 1482 return retbuf;
1478} 1483}
1479 1484
1480/* formula_msg() - generate a message detailing the properties 1485/* formula_msg() - generate a message detailing the properties
1481 * of a randomly selected alchemical formula. 1486 * of a randomly selected alchemical formula.
1805 { /* we got no information beyond the preamble! */ 1810 { /* we got no information beyond the preamble! */
1806 strcat (retbuf, " [Unfortunately the rest of the information is\n"); 1811 strcat (retbuf, " [Unfortunately the rest of the information is\n");
1807 strcat (retbuf, " hopelessly garbled!]\n ---\n"); 1812 strcat (retbuf, " hopelessly garbled!]\n ---\n");
1808 } 1813 }
1809#ifdef BOOK_MSG_DEBUG 1814#ifdef BOOK_MSG_DEBUG
1810 LOG (llevDebug, "\n god_info_msg() created strng: %d\n", strlen (retbuf)); 1815 LOG (llevDebug, "\n god_info_msg() created string: %d\n", strlen (retbuf));
1811 fprintf (logfile, " MADE THIS:\n%s", retbuf); 1816 LOG (llevDebug, " MADE THIS:\n%s", retbuf);
1812#endif 1817#endif
1813 return retbuf; 1818 return retbuf;
1814} 1819}
1815 1820
1816/* tailor_readable_ob()- The main routine. This chooses a random 1821/* tailor_readable_ob()- The main routine. This chooses a random

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines