… | |
… | |
74 | } |
74 | } |
75 | |
75 | |
76 | /* check_recipe() - makes sure we actually have the requested artifact |
76 | /* check_recipe() - makes sure we actually have the requested artifact |
77 | * and archetype. */ |
77 | * and archetype. */ |
78 | |
78 | |
79 | static int check_recipe(const recipe *rp) { |
79 | static int check_recipe(recipe *rp) { |
80 | size_t i; |
80 | size_t i; |
81 | int result; |
81 | int result; |
82 | |
82 | |
83 | result = 1; |
83 | result = 1; |
84 | for (i = 0; i < rp->arch_names; i++) { |
84 | for (i = 0; i < rp->arch_names; i++) { |
… | |
… | |
282 | } |
282 | } |
283 | |
283 | |
284 | /* Find a treasure with a matching name. The 'depth' parameter is |
284 | /* Find a treasure with a matching name. The 'depth' parameter is |
285 | * only there to prevent infinite loops in treasure lists (a list |
285 | * only there to prevent infinite loops in treasure lists (a list |
286 | * referencing another list pointing back to the first one). */ |
286 | * referencing another list pointing back to the first one). */ |
287 | archetype *find_treasure_by_name (const treasure *t, const char *name, int depth) |
287 | archetype *find_treasure_by_name (treasure *t, const char *name, int depth) |
288 | { |
288 | { |
289 | treasurelist *tl; |
289 | treasurelist *tl; |
290 | archetype *at; |
290 | archetype *at; |
291 | |
291 | |
292 | if (depth > 10) |
292 | if (depth > 10) |
… | |
… | |
523 | cp++; len--; |
523 | cp++; len--; |
524 | } |
524 | } |
525 | return val*mult; |
525 | return val*mult; |
526 | } |
526 | } |
527 | |
527 | |
528 | artifact * locate_recipe_artifact(const recipe *rp, size_t idx) { |
528 | artifact * locate_recipe_artifact(recipe *rp, size_t idx) { |
529 | object *item=get_archetype(rp->arch_name[idx]); |
529 | object *item=get_archetype(rp->arch_name[idx]); |
530 | artifactlist *at=NULL; |
530 | artifactlist *at=NULL; |
531 | artifact *art=NULL; |
531 | artifact *art=NULL; |
532 | |
532 | |
533 | if(!item) return (artifact *) NULL; |
533 | if(!item) return (artifact *) NULL; |