… | |
… | |
403 | LOG (llevDebug, "make_alchemy_item(): failed to create alchemical object.\n"); |
403 | LOG (llevDebug, "make_alchemy_item(): failed to create alchemical object.\n"); |
404 | return (object *) NULL; |
404 | return (object *) NULL; |
405 | } |
405 | } |
406 | |
406 | |
407 | /* Find the appropriate artifact template... */ |
407 | /* Find the appropriate artifact template... */ |
408 | if (strcmp (rp->title, "NONE")) |
408 | if (rp->title != shstr_NONE) |
409 | { |
409 | { |
410 | if ((art = locate_recipe_artifact (rp, rp_arch_index)) == NULL) |
410 | if ((art = locate_recipe_artifact (rp, rp_arch_index)) == NULL) |
411 | { |
411 | { |
412 | LOG (llevError, "make_alchemy_item(): failed to locate recipe artifact.\n"); |
412 | LOG (llevError, "make_alchemy_item(): failed to locate recipe artifact.\n"); |
413 | LOG (llevDebug, " --requested recipe: %s of %s.\n", rp->arch_name[0], &rp->title); |
413 | LOG (llevDebug, " --requested recipe: %s of %s.\n", rp->arch_name[0], &rp->title); |
414 | return (object *) NULL; |
414 | return (object *) NULL; |
415 | } |
415 | } |
|
|
416 | |
416 | transmute_materialname (item, art->item); |
417 | transmute_materialname (item, art->item); |
417 | give_artifact_abilities (item, art->item); |
418 | give_artifact_abilities (item, art->item); |
418 | } |
419 | } |
419 | |
420 | |
420 | if (QUERY_FLAG (cauldron, FLAG_CURSED)) |
421 | if (QUERY_FLAG (cauldron, FLAG_CURSED)) |
… | |
… | |
443 | *rp_arch_index = 0; |
444 | *rp_arch_index = 0; |
444 | |
445 | |
445 | if (rp->transmute) /* look for matching ingredient/prod archs */ |
446 | if (rp->transmute) /* look for matching ingredient/prod archs */ |
446 | for (item = first_ingred; item; item = item->below) |
447 | for (item = first_ingred; item; item = item->below) |
447 | { |
448 | { |
448 | size_t i; |
449 | int i; |
449 | |
450 | |
450 | for (i = 0; i < rp->arch_names; i++) |
451 | for (int i = 0; i < rp->arch_names; i++) |
451 | { |
452 | //TODO: should be a shstr comparison |
452 | if (item->arch->archname == rp->arch_name[i]) |
453 | if (&item->arch->archname == rp->arch_name[i]) |
453 | { |
454 | { |
454 | *rp_arch_index = i; |
455 | *rp_arch_index = i; |
455 | break; |
456 | break; |
456 | } |
457 | } |
457 | } |
|
|
458 | |
458 | |
459 | if (i < rp->arch_names) |
459 | if (i < rp->arch_names) |
460 | break; |
460 | break; |
461 | } |
461 | } |
462 | |
462 | |
… | |
… | |
838 | for (ob = cauldron->inv; ob != NULL; ob = ob->below) |
838 | for (ob = cauldron->inv; ob != NULL; ob = ob->below) |
839 | { |
839 | { |
840 | char name_ob[MAX_BUF]; |
840 | char name_ob[MAX_BUF]; |
841 | const char *name2; |
841 | const char *name2; |
842 | |
842 | |
843 | if (ob->title == NULL) |
843 | if (!ob->title) |
844 | name2 = ob->name; |
844 | name2 = ob->name; |
845 | else |
845 | else |
846 | { |
846 | { |
847 | snprintf (name_ob, sizeof (name_ob), "%s %s", &ob->name, &ob->title); |
847 | snprintf (name_ob, sizeof (name_ob), "%s %s", &ob->name, &ob->title); |
848 | name2 = name_ob; |
848 | name2 = name_ob; |