Difference for common/item.c from version 1.33 to 1.34


version 1.33 version 1.34
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_item_c =   * static char *rcsid_item_c =
  *   "$Id: item.c,v 1.33 2003/01/30 00:07:07 garbled Exp $";   *   "$Id: item.c,v 1.34 2003/02/07 06:57:16 garbled Exp $";
  */   */
   
 /*  /*
Line 466
 
Line 466
     static char buf[5][HUGE_BUF];      static char buf[5][HUGE_BUF];
     static int use_buf=0;      static int use_buf=0;
     int len=0;      int len=0;
       materialtype_t *mt;
   
     use_buf++;      use_buf++;
     use_buf %=5;      use_buf %=5;
   
       if ((IS_ARMOR(op) || IS_WEAPON(op)) && op->materialname) {
    mt = name_to_material(op->materialname);
    if (mt) {
        safe_strcat(buf[use_buf], mt->description, &len, HUGE_BUF);
        safe_strcat(buf[use_buf], " ", &len, HUGE_BUF);
    }
       }
   
     safe_strcat(buf[use_buf], query_short_name(op), &len, HUGE_BUF);      safe_strcat(buf[use_buf], query_short_name(op), &len, HUGE_BUF);
   
     if (QUERY_FLAG(op,FLAG_INV_LOCKED))      if (QUERY_FLAG(op,FLAG_INV_LOCKED))
Line 544
 
Line 553
 char *query_base_name(object *op, int plural) {  char *query_base_name(object *op, int plural) {
     static char buf[MAX_BUF];      static char buf[MAX_BUF];
     int len;      int len;
       materialtype_t *mt;
   
     if((!plural && !op->name) || (plural && !op->name_pl))      if((!plural && !op->name) || (plural && !op->name_pl))
  return "(null)";   return "(null)";
Line 551
 
Line 561
     if(!op->nrof && !op->weight && !op->title && !is_magical(op))       if(!op->nrof && !op->weight && !op->title && !is_magical(op))
  return op->name; /* To speed things up (or make things slower?) */   return op->name; /* To speed things up (or make things slower?) */
   
       if ((IS_ARMOR(op) || IS_WEAPON(op)) && op->materialname)
    mt = name_to_material(op->materialname);
   
       if ((IS_ARMOR(op) || IS_WEAPON(op)) && op->materialname && mt) {
    strcpy(buf, mt->description);
    len=strlen(buf);
    safe_strcat(buf, " ", &len, MAX_BUF);
    if (!plural)
        safe_strcat(buf, op->name, &len, MAX_BUF);
    else
        safe_strcat(buf, op->name_pl, &len, MAX_BUF);
       } else {
     if (!plural)       if (!plural)
  strcpy(buf,op->name);   strcpy(buf,op->name);
     else      else
  strcpy(buf,op->name_pl);   strcpy(buf,op->name_pl);
     len=strlen(buf);      len=strlen(buf);
       }
   
     if (op->title && QUERY_FLAG(op,FLAG_IDENTIFIED)) {      if (op->title && QUERY_FLAG(op,FLAG_IDENTIFIED)) {
  safe_strcat(buf, " ", &len, MAX_BUF);   safe_strcat(buf, " ", &len, MAX_BUF);


Legend:
line(s) removed in v.1.33 
line(s) changed
 line(s) added in v.1.34

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