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.30 by root, Fri Nov 6 12:49:19 2009 UTC vs.
Revision 1.31 by root, Fri Nov 6 13:03:34 2009 UTC

286} 286}
287 287
288/* Find a treasure with a matching name. The 'depth' parameter is 288/* Find a treasure with a matching name. The 'depth' parameter is
289 * only there to prevent infinite loops in treasure lists (a list 289 * only there to prevent infinite loops in treasure lists (a list
290 * referencing another list pointing back to the first one). */ 290 * referencing another list pointing back to the first one). */
291archetype * 291static archetype *
292find_treasure_by_name (const treasure *t, const char *name, int depth) 292find_treasure_by_name (const treasure *t, const char *name, int depth)
293{ 293{
294 if (depth > 10) 294 if (depth > 10)
295 return 0; 295 return 0;
296 296
329 * monsters' body parts, there may be several monsters with the same 329 * monsters' body parts, there may be several monsters with the same
330 * name. This is not a problem if these monsters have the same level 330 * name. This is not a problem if these monsters have the same level
331 * (e.g. sage & c_sage) or if only one of the monsters generates the 331 * (e.g. sage & c_sage) or if only one of the monsters generates the
332 * body parts that we are looking for (e.g. big_dragon and 332 * body parts that we are looking for (e.g. big_dragon and
333 * big_dragon_worthless). */ 333 * big_dragon_worthless). */
334long 334static long
335find_ingred_cost (const char *name) 335find_ingred_cost (const char *name)
336{ 336{
337 archetype *at2; 337 archetype *at2;
338 artifactlist *al; 338 artifactlist *al;
339 artifact *art; 339 artifact *art;
414 414
415 /* failed to find any matching items -- formula should be checked */ 415 /* failed to find any matching items -- formula should be checked */
416 return -1; 416 return -1;
417} 417}
418 418
419const char * 419static const char *
420ingred_name (const char *name) 420ingred_name (const char *name)
421{ 421{
422 const char *cp = name; 422 const char *cp = name;
423 423
424 if (atoi (cp)) 424 if (atoi (cp))
425 cp = strchr (cp, ' ') + 1; 425 cp = strchr (cp, ' ') + 1;
426 426
427 return cp; 427 return cp;
428} 428}
429 429
430int 430static int
431numb_ingred (const char *buf) 431numb_ingred (const char *buf)
432{ 432{
433 int numb; 433 int numb;
434 434
435 if ((numb = atoi (buf))) 435 if ((numb = atoi (buf)))
471 return art; 471 return art;
472 472
473 return 0; 473 return 0;
474} 474}
475 475
476recipelist * 476static recipelist *
477get_random_recipelist (void) 477get_random_recipelist (void)
478{ 478{
479 recipelist *fl = NULL; 479 recipelist *fl = NULL;
480 int number = 0, roll = 0; 480 int number = 0, roll = 0;
481 481
527 } 527 }
528 } 528 }
529 return rp; 529 return rp;
530} 530}
531 531
532void 532static void
533free_all_recipes (void) 533free_all_recipes (void)
534{ 534{
535 recipelist *fl = formulalist, *flnext; 535 recipelist *fl = formulalist, *flnext;
536 recipe *formula = NULL, *next; 536 recipe *formula = NULL, *next;
537 linked_char *lchar, *charnext; 537 linked_char *lchar, *charnext;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines