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.3 by root, Sun Sep 3 00:18:40 2006 UTC vs.
Revision 1.4 by elmex, Sun Sep 3 14:33:47 2006 UTC

1/* 1/*
2 * static char *rcsid_readable_c = 2 * static char *rcsid_readable_c =
3 * "$Id: readable.C,v 1.3 2006/09/03 00:18:40 root Exp $"; 3 * "$Id: readable.C,v 1.4 2006/09/03 14:33:47 elmex Exp $";
4 */ 4 */
5 5
6/* 6/*
7 CrossFire, A Multiplayer game for X-windows 7 CrossFire, A Multiplayer game for X-windows
8 8
1619 const char *op_name = formula->arch_name[RANDOM()%formula->arch_names]; 1619 const char *op_name = formula->arch_name[RANDOM()%formula->arch_names];
1620 archetype *at; 1620 archetype *at;
1621 1621
1622 /* preamble */ 1622 /* preamble */
1623 sprintf(retbuf, "Herein is described a project using %s: \n", 1623 sprintf(retbuf, "Herein is described a project using %s: \n",
1624 formula->skill?formula->skill:"an unknown skill"); 1624 formula->skill ? &formula->skill : "an unknown skill");
1625 1625
1626 if ((at = find_archetype (op_name)) != (archetype *) NULL) 1626 if ((at = find_archetype (op_name)) != (archetype *) NULL)
1627 op_name = at->clone.name; 1627 op_name = at->clone.name;
1628 else 1628 else
1629 LOG (llevError, "formula_msg() can't find arch %s for formula.\n", 1629 LOG (llevError, "formula_msg() can't find arch %s for formula.\n",
1630 op_name); 1630 op_name);
1631 1631
1632 /* item name */ 1632 /* item name */
1633 if (strcmp (formula->title, "NONE")) { 1633 if (strcmp (formula->title, "NONE")) {
1634 sprintf (retbuf, "%sThe %s of %s", retbuf, op_name, formula->title); 1634 sprintf (retbuf, "%sThe %s of %s", retbuf, op_name, &formula->title);
1635 /* This results in things like pile of philo. sulfur. 1635 /* This results in things like pile of philo. sulfur.
1636 * while philo. sulfur may look better, without this, 1636 * while philo. sulfur may look better, without this,
1637 * you get things like 'the wise' because its missing the 1637 * you get things like 'the wise' because its missing the
1638 * water of section. 1638 * water of section.
1639 */ 1639 */
1640 sprintf(title,"%s: %s of %s", 1640 sprintf(title,"%s: %s of %s",
1641 formula_book_name[RANDOM() % (sizeof(formula_book_name) / sizeof(char*))], 1641 formula_book_name[RANDOM() % (sizeof(formula_book_name) / sizeof(char*))],
1642 op_name, formula->title); 1642 op_name, &formula->title);
1643 } 1643 }
1644 else 1644 else
1645 { 1645 {
1646 sprintf (retbuf, "%sThe %s", retbuf, op_name); 1646 sprintf (retbuf, "%sThe %s", retbuf, op_name);
1647 sprintf(title,"%s: %s", 1647 sprintf(title,"%s: %s",
1677 strcat (retbuf, "\n"); 1677 strcat (retbuf, "\n");
1678 } 1678 }
1679 } 1679 }
1680 else 1680 else
1681 LOG (llevError, "formula_msg() no ingredient list for object %s of %s\n", 1681 LOG (llevError, "formula_msg() no ingredient list for object %s of %s\n",
1682 op_name, formula->title); 1682 op_name, &formula->title);
1683 if (retbuf[strlen(retbuf)-1]!= '\n') strcat(retbuf, "\n"); 1683 if (retbuf[strlen(retbuf)-1]!= '\n') strcat(retbuf, "\n");
1684 1684
1685 book->msg = retbuf; 1685 book->msg = retbuf;
1686 } 1686 }
1687} 1687}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines