Difference for common/readable.c from version 1.25 to 1.26


version 1.25 version 1.26
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_readable_c =   * static char *rcsid_readable_c =
  *   "$Id: readable.c,v 1.25 2005/10/28 19:08:53 akirschbaum Exp $";   *   "$Id: readable.c,v 1.26 2005/10/31 21:23:00 akirschbaum Exp $";
  */   */
   
 /*  /*
Line 1592
 
Line 1592
  */   */
   
 void make_formula_book(object *book, int level) {  void make_formula_book(object *book, int level) {
     char retbuf[BOOK_BUF], title[MAX_BUF], *dup = NULL;      char retbuf[BOOK_BUF], title[MAX_BUF];
     recipelist *fl;      recipelist *fl;
     recipe *formula = NULL;      recipe *formula = NULL;
     int     chance;      int     chance;
Line 1621
 
Line 1621
      break;       break;
     }      }
   
     if (!formula) {      if (!formula || formula->arch_names <= 0) {
  book->msg = add_string(" <indecipherable text>\n");   book->msg = add_string(" <indecipherable text>\n");
  new_text_name(book, 4);   new_text_name(book, 4);
  add_author(book,4);   add_author(book,4);
Line 1631
 
Line 1631
  * of information on the booklevel and the spellevel   * of information on the booklevel and the spellevel
  * of the formula. */   * of the formula. */
   
  const char   *op_name = NULL;   const char   *op_name = formula->arch_name[RANDOM()%formula->arch_names];
  archetype *at;   archetype *at;
  int     nindex = nstrtok (formula->arch_name, ",");  
   
  /* preamble */   /* preamble */
  sprintf(retbuf, "Herein is described a project using %s: \n",    sprintf(retbuf, "Herein is described a project using %s: \n",
  formula->skill?formula->skill:"an unknown skill");   formula->skill?formula->skill:"an unknown skill");
   
  /* construct name of object to be made */  
  if (nindex > 1)  
  {  
      int     rnum = RANDOM () % nindex;  
         dup = strdup_local(formula->arch_name);  
      op_name = strtok (dup, ",");  
      while (rnum)  
      {  
  op_name = strtok (NULL, ",");  
  rnum--;  
      }  
  }  
  else  
      op_name = formula->arch_name;  
   
  if ((at = find_archetype (op_name)) != (archetype *) NULL)   if ((at = find_archetype (op_name)) != (archetype *) NULL)
      op_name = at->clone.name;       op_name = at->clone.name;
  else   else
Line 1719
 
Line 1703
  if (book->msg) free_string(book->msg);   if (book->msg) free_string(book->msg);
  book->msg = add_string(retbuf);   book->msg = add_string(retbuf);
     }      }
     free(dup);  
 }  }
   
   


Legend:
line(s) removed in v.1.25 
line(s) changed
 line(s) added in v.1.26

File made using version 1.98 of cvs2html by leaf at 2011-07-21 17:17