Difference for common/item.c from version 1.10 to 1.11


version 1.10 version 1.11
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_item_c =   * static char *rcsid_item_c =
  *   "$Id: item.c,v 1.10 2000/10/18 20:00:39 peterm Exp $";   *   "$Id: item.c,v 1.11 2000/11/08 07:19:37 cvs Exp $";
  */   */
   
 /*  /*
Line 399
 
Line 399
  return op->name; /* To speed things up (or make things slower?) */   return op->name; /* To speed things up (or make things slower?) */
   
     strcpy(buf,op->name);      strcpy(buf,op->name);
       len=strlen(buf);
   
     /* This code pretty much taken directly from query_short_name */      /* This code pretty much taken directly from query_short_name */
     if (plural) {      if (plural) {
Line 406
 
Line 407
  if (buf3!=NULL) {   if (buf3!=NULL) {
      strcpy(buf2, buf3);       strcpy(buf2, buf3);
      *buf3 = '\0';   /* also changes value in buf */       *buf3 = '\0';   /* also changes value in buf */
  }  
  len=strlen(buf);   len=strlen(buf);
    }
   
  if(QUERY_FLAG(op,FLAG_NEED_IE)) {   if(QUERY_FLAG(op,FLAG_NEED_IE)) {
      char *cp=strrchr(buf,'y');       char *cp=strrchr(buf,'y');
Line 436
 
Line 437
   
   
     if (op->title && QUERY_FLAG(op,FLAG_IDENTIFIED)) {      if (op->title && QUERY_FLAG(op,FLAG_IDENTIFIED)) {
  strcat(buf, " ");   safe_strcat(buf, " ", &len, MAX_BUF);
  strcat(buf, op->title);   safe_strcat(buf, op->title, &len, MAX_BUF);
     }      }
   
     switch(op->type) {      switch(op->type) {
       case SPELLBOOK:        case SPELLBOOK:
  if (QUERY_FLAG(op,FLAG_IDENTIFIED)||QUERY_FLAG(op,FLAG_BEEN_APPLIED)) {   if (QUERY_FLAG(op,FLAG_IDENTIFIED)||QUERY_FLAG(op,FLAG_BEEN_APPLIED)) {
      if(!op->title) {       if(!op->title) {
  strcat(buf," of ");   safe_strcat(buf," of ", &len, MAX_BUF);
  if(op->slaying) strcat(buf,op->slaying);   if(op->slaying) safe_strcat(buf,op->slaying, &len, MAX_BUF);
  else   else
    strcat(buf,spells[op->stats.sp].name);     safe_strcat(buf,spells[op->stats.sp].name, &len, MAX_BUF);
  if(op->type != SPELLBOOK)   if(op->type != SPELLBOOK)
      sprintf(buf+strlen(buf), " (lvl %d)", op->level);       sprintf(buf+strlen(buf), " (lvl %d)", op->level);
      }       }
  }   }
  break;   break;
   
       case SCROLL:        case SCROLL:
       case WAND:        case WAND:
   
       case ROD:        case ROD:
  if (QUERY_FLAG(op,FLAG_IDENTIFIED)||QUERY_FLAG(op,FLAG_BEEN_APPLIED)) {   if (QUERY_FLAG(op,FLAG_IDENTIFIED)||QUERY_FLAG(op,FLAG_BEEN_APPLIED)) {
      if(!op->title) {       if(!op->title) {
  strcat(buf," of ");   safe_strcat(buf," of ", &len, MAX_BUF);
  strcat(buf,spells[op->stats.sp].name);   safe_strcat(buf,spells[op->stats.sp].name, &len, MAX_BUF);
  if(op->type != SPELLBOOK)   if(op->type != SPELLBOOK)
      sprintf(buf+strlen(buf), " (lvl %d)", op->level);       sprintf(buf+strlen(buf), " (lvl %d)", op->level);
      }       }
Line 475
 
Line 476
      /* If ring has a title, full description isn't so useful */        /* If ring has a title, full description isn't so useful */
      char *s = ring_desc(op);       char *s = ring_desc(op);
      if (s[0]) {       if (s[0]) {
  strcat (buf, " ");   safe_strcat (buf, " ", &len, MAX_BUF);
  strcat (buf, s);   safe_strcat (buf, s, &len, MAX_BUF);
      }       }
  }   }
 #endif  #endif


Legend:
line(s) removed in v.1.10 
line(s) changed
 line(s) added in v.1.11

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