… | |
… | |
561 | * returned is good forever.) However, it makes printing statements that |
561 | * returned is good forever.) However, it makes printing statements that |
562 | * use several names much easier (don't need to store them to temp variables.) |
562 | * use several names much easier (don't need to store them to temp variables.) |
563 | * |
563 | * |
564 | * It is used extensively within messages, so should return only a prose |
564 | * It is used extensively within messages, so should return only a prose |
565 | * and short description of the item. |
565 | * and short description of the item. |
|
|
566 | * It is also used by examine/ex and similar functions. |
566 | */ |
567 | */ |
567 | const char * |
568 | const char * |
568 | query_name (const object *op) |
569 | query_name (const object *op) |
569 | { |
570 | { |
570 | int len = 0; |
571 | int len = 0; |
… | |
… | |
686 | * and sending to client. |
687 | * and sending to client. |
687 | * If plural is set, we generate the plural name of this. |
688 | * If plural is set, we generate the plural name of this. |
688 | * |
689 | * |
689 | * It is sometimes used to display messages, and usually only used to match stuff, |
690 | * It is sometimes used to display messages, and usually only used to match stuff, |
690 | * so maybe this function should be removed. |
691 | * so maybe this function should be removed. |
|
|
692 | * It is also used for client-side inventory/item descriptions. |
691 | */ |
693 | */ |
692 | const char * |
694 | const char * |
693 | query_base_name (const object *op, int plural) |
695 | query_base_name (const object *op, int plural) |
694 | { |
696 | { |
695 | if ((!plural && !op->name) || (plural && !op->name_pl)) |
697 | if ((!plural && !op->name) || (plural && !op->name_pl)) |
696 | return "(null)"; |
698 | return "(null)"; |
697 | |
699 | |
698 | if (!op->nrof && !op->weight && !op->title && !is_magical (op)) |
700 | if (!op->nrof && !op->weight && !op->title && !is_magical (op) |
|
|
701 | && op->type != EXIT) |
699 | return op->name; /* To speed things up (or make things slower?) */ |
702 | return op->name; /* To speed things up (or make things slower?) */ |
700 | |
703 | |
701 | static dynbuf_text buf; buf.clear (); |
704 | static dynbuf_text buf; buf.clear (); |
702 | |
705 | |
703 | #if 0 |
706 | #if 0 |