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

Comparing deliantra/server/common/recipe.C (file contents):
Revision 1.5 by root, Sun Sep 10 16:00:23 2006 UTC vs.
Revision 1.8 by root, Tue Dec 12 20:53:02 2006 UTC

1
2
3/* Basic stuff for use with the alchemy code. Clearly some of this stuff 1/* Basic stuff for use with the alchemy code. Clearly some of this stuff
4 * could go into server/alchemy, but I left it here just in case it proves 2 * could go into server/alchemy, but I left it here just in case it proves
5 * more generally useful. 3 * more generally useful.
6 * 4 *
7 * Nov 1995 - file created by b.t. thomas@astro.psu.edu 5 * Nov 1995 - file created by b.t. thomas@astro.psu.edu
89 int result; 87 int result;
90 88
91 result = 1; 89 result = 1;
92 for (i = 0; i < rp->arch_names; i++) 90 for (i = 0; i < rp->arch_names; i++)
93 { 91 {
94 if (find_archetype (rp->arch_name[i]) != NULL) 92 if (archetype::find (rp->arch_name[i]) != NULL)
95 { 93 {
96 artifact *art = locate_recipe_artifact (rp, i); 94 artifact *art = locate_recipe_artifact (rp, i);
97 95
98 if (!art && strcmp (rp->title, "NONE") != 0) 96 if (!art && strcmp (rp->title, "NONE") != 0)
99 { 97 {
299 297
300 for (i = 0; i < formula->arch_names; i++) 298 for (i = 0; i < formula->arch_names; i++)
301 { 299 {
302 const char *string = formula->arch_name[i]; 300 const char *string = formula->arch_name[i];
303 301
304 if (find_archetype (string) != NULL) 302 if (archetype::find (string) != NULL)
305 { 303 {
306 art = locate_recipe_artifact (formula, i); 304 art = locate_recipe_artifact (formula, i);
307 if (!art && strcmp (formula->title, "NONE")) 305 if (!art && strcmp (formula->title, "NONE"))
308 LOG (llevError, "Formula %s has no artifact\n", &formula->title); 306 LOG (llevError, "Formula %s has no artifact\n", &formula->title);
309 else 307 else
506 504
507 for (i = 0; i < formula->arch_names; i++) 505 for (i = 0; i < formula->arch_names; i++)
508 { 506 {
509 const char *string = formula->arch_name[i]; 507 const char *string = formula->arch_name[i];
510 508
511 if ((at = find_archetype (string)) != NULL) 509 if ((at = archetype::find (string)) != NULL)
512 { 510 {
513 art = locate_recipe_artifact (formula, i); 511 art = locate_recipe_artifact (formula, i);
514 if (!art && strcmp (formula->title, "NONE")) 512 if (!art && strcmp (formula->title, "NONE"))
515 LOG (llevError, "Formula %s has no artifact\n", &formula->title); 513 LOG (llevError, "Formula %s has no artifact\n", &formula->title);
516 else 514 else
615 if ((at = find_artifactlist (item->type))) 613 if ((at = find_artifactlist (item->type)))
616 for (art = at->items; art; art = art->next) 614 for (art = at->items; art; art = art->next)
617 if (!strcmp (art->item->name, rp->title)) 615 if (!strcmp (art->item->name, rp->title))
618 break; 616 break;
619 617
620 free_object (item); 618 item->destroy (0);
621 619
622 return art; 620 return art;
623} 621}
624 622
625int 623int

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines