… | |
… | |
818 | else |
818 | else |
819 | t = t->next; |
819 | t = t->next; |
820 | |
820 | |
821 | #ifdef ARCHIVE_DEBUG |
821 | #ifdef ARCHIVE_DEBUG |
822 | if (t) |
822 | if (t) |
823 | 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); |
824 | #endif |
824 | #endif |
825 | |
825 | |
826 | return t; |
826 | return t; |
827 | } |
827 | } |
828 | |
828 | |
… | |
… | |
976 | |
976 | |
977 | /* We have stuff we need to write now */ |
977 | /* We have stuff we need to write now */ |
978 | need_to_write_bookarchive = 1; |
978 | need_to_write_bookarchive = 1; |
979 | |
979 | |
980 | #ifdef ARCHIVE_DEBUG |
980 | #ifdef ARCHIVE_DEBUG |
981 | 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); |
982 | #endif |
982 | #endif |
983 | |
983 | |
984 | } |
984 | } |
985 | |
985 | |
986 | |
986 | |
… | |
… | |
1052 | if (numb == maxnames) |
1052 | if (numb == maxnames) |
1053 | { |
1053 | { |
1054 | #ifdef ARCHIVE_DEBUG |
1054 | #ifdef ARCHIVE_DEBUG |
1055 | 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); |
1056 | #endif |
1056 | #endif |
1057 | break; |
|
|
1058 | } |
1057 | } |
1059 | /* shouldnt change map-maker books */ |
1058 | /* shouldnt change map-maker books */ |
1060 | else if (!book->title) |
1059 | else if (!book->title) |
1061 | do |
1060 | do |
1062 | { |
1061 | { |
… | |
… | |
1077 | */ |
1076 | */ |
1078 | |
1077 | |
1079 | if (tries == MAX_TITLE_CHECK || numb == maxnames) |
1078 | if (tries == MAX_TITLE_CHECK || numb == maxnames) |
1080 | { /* got to check maxnames again */ |
1079 | { /* got to check maxnames again */ |
1081 | #ifdef ARCHIVE_DEBUG |
1080 | #ifdef ARCHIVE_DEBUG |
1082 | 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); |
1083 | #endif |
1082 | #endif |
1084 | /* restore old book properties here */ |
1083 | /* restore old book properties here */ |
1085 | book->title = old_title; |
1084 | book->title = old_title; |
1086 | |
1085 | |
1087 | if (rndm (4)) |
1086 | if (rndm (4)) |
… | |
… | |
1271 | /* Note that the value this returns is not based on level */ |
1270 | /* Note that the value this returns is not based on level */ |
1272 | tmp = get_next_mon (tmp); |
1271 | tmp = get_next_mon (tmp); |
1273 | } |
1272 | } |
1274 | |
1273 | |
1275 | #ifdef BOOK_MSG_DEBUG |
1274 | #ifdef BOOK_MSG_DEBUG |
1276 | 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)); |
1277 | fprintf (logfile, " MADE THIS:\n%s\n", retbuf); |
1276 | LOG (llevDebug, " MADE THIS:\n%s\n", retbuf); |
1278 | #endif |
1277 | #endif |
1279 | |
1278 | |
1280 | return retbuf; |
1279 | return retbuf; |
1281 | } |
1280 | } |
1282 | |
1281 | |
… | |
… | |
1406 | art = art->next; |
1405 | art = art->next; |
1407 | book_entries--; |
1406 | book_entries--; |
1408 | } |
1407 | } |
1409 | |
1408 | |
1410 | #ifdef BOOK_MSG_DEBUG |
1409 | #ifdef BOOK_MSG_DEBUG |
1411 | LOG (llevDebug, "artifact_msg() created strng: %d\n", strlen (retbuf)); |
1410 | LOG (llevDebug, "artifact_msg() created string: %d\n", strlen (retbuf)); |
1412 | fprintf (logfile, " MADE THIS:\n%s", retbuf); |
1411 | LOG (llevDebug, " MADE THIS:\n%s", retbuf); |
1413 | #endif |
1412 | #endif |
1414 | return retbuf; |
1413 | return retbuf; |
1415 | } |
1414 | } |
1416 | |
1415 | |
1417 | /***************************************************************************** |
1416 | /***************************************************************************** |
… | |
… | |
1473 | } |
1472 | } |
1474 | else |
1473 | else |
1475 | { |
1474 | { |
1476 | strcat (retbuf, "\n"); |
1475 | strcat (retbuf, "\n"); |
1477 | } |
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 |
1478 | return retbuf; |
1482 | return retbuf; |
1479 | } |
1483 | } |
1480 | |
1484 | |
1481 | /* formula_msg() - generate a message detailing the properties |
1485 | /* formula_msg() - generate a message detailing the properties |
1482 | * of a randomly selected alchemical formula. |
1486 | * of a randomly selected alchemical formula. |
… | |
… | |
1806 | { /* we got no information beyond the preamble! */ |
1810 | { /* we got no information beyond the preamble! */ |
1807 | strcat (retbuf, " [Unfortunately the rest of the information is\n"); |
1811 | strcat (retbuf, " [Unfortunately the rest of the information is\n"); |
1808 | strcat (retbuf, " hopelessly garbled!]\n ---\n"); |
1812 | strcat (retbuf, " hopelessly garbled!]\n ---\n"); |
1809 | } |
1813 | } |
1810 | #ifdef BOOK_MSG_DEBUG |
1814 | #ifdef BOOK_MSG_DEBUG |
1811 | 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)); |
1812 | fprintf (logfile, " MADE THIS:\n%s", retbuf); |
1816 | LOG (llevDebug, " MADE THIS:\n%s", retbuf); |
1813 | #endif |
1817 | #endif |
1814 | return retbuf; |
1818 | return retbuf; |
1815 | } |
1819 | } |
1816 | |
1820 | |
1817 | /* tailor_readable_ob()- The main routine. This chooses a random |
1821 | /* tailor_readable_ob()- The main routine. This chooses a random |