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.38 by root, Sat Dec 27 02:31:19 2008 UTC vs.
Revision 1.40 by root, Thu Jan 1 11:41:17 2009 UTC

932 */ 932 */
933 933
934static int 934static int
935unique_book (const object *book, int msgtype) 935unique_book (const object *book, int msgtype)
936{ 936{
937 title *test;
938
939 if (!booklist) 937 if (!booklist)
940 return 1; /* No archival entries! Must be unique! */ 938 return 1; /* No archival entries! Must be unique! */
941 939
942 /* Go through the booklist. If the author and name match, not unique so 940 /* Go through the booklist. If the author and name match, not unique so
943 * return 0. 941 * return 0.
944 */ 942 */
945 for (test = get_titlelist (msgtype)->first_book; test; test = test->next) 943 for (title *test = get_titlelist (msgtype)->first_book; test; test = test->next)
946 {
947 if (!strcmp (test->name, book->name) && !strcmp (book->title, test->authour)) 944 if (test->name == book->name && book->title == test->authour)
948 return 0; 945 return 0;
949 } 946
950 return 1; 947 return 1;
951} 948}
952 949
953/* add_book_to_list() */ 950/* add_book_to_list() */
954 951
1352 1349
1353 /* separator of items */ 1350 /* separator of items */
1354 strcpy (buf, "--- \n"); 1351 strcpy (buf, "--- \n");
1355 1352
1356 /* Name */ 1353 /* Name */
1357 if (art->allowed != NULL && strcmp (art->allowed->name, "All")) 1354 if (art->allowed && art->allowed->name != shstr_All)
1358 { 1355 {
1359 linked_char *temp, *next = art->allowed; 1356 linked_char *temp, *next = art->allowed;
1360 1357
1361 do 1358 do
1362 { 1359 {
1539 op_name = at->object::name; 1536 op_name = at->object::name;
1540 else 1537 else
1541 LOG (llevError, "formula_msg() can't find arch %s for formula.\n", op_name); 1538 LOG (llevError, "formula_msg() can't find arch %s for formula.\n", op_name);
1542 1539
1543 /* item name */ 1540 /* item name */
1544 if (strcmp (formula->title, "NONE")) 1541 if (formula->title != shstr_NONE)
1545 { 1542 {
1546 sprintf (retbuf, "%sThe %s of %s", retbuf, op_name, &formula->title); 1543 sprintf (retbuf, "%sThe %s of %s", retbuf, op_name, &formula->title);
1547 /* This results in things like pile of philo. sulfur. 1544 /* This results in things like pile of philo. sulfur.
1548 * while philo. sulfur may look better, without this, 1545 * while philo. sulfur may look better, without this,
1549 * you get things like 'the wise' because its missing the 1546 * you get things like 'the wise' because its missing the
1562 strcat (retbuf, at->title); 1559 strcat (retbuf, at->title);
1563 strcat (title, " "); 1560 strcat (title, " ");
1564 strcat (title, at->title); 1561 strcat (title, at->title);
1565 } 1562 }
1566 } 1563 }
1564
1567 /* Lets name the book something meaningful ! */ 1565 /* Lets name the book something meaningful ! */
1568 book->name = title; 1566 book->name = title;
1569 book->title = NULL; 1567 book->title = NULL;
1570 1568
1571 /* ingredients to make it */ 1569 /* ingredients to make it */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines