version 1.33 | | version 1.34 |
---|
| | |
/* | | /* |
* 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 $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
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)) |
| | |
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)"; |
| | |
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); |