MCPcopy Create free account
hub / github.com/NetHack/NetHack / disco_fmt_uniq

Function disco_fmt_uniq

src/o_init.c:724–737  ·  view source on GitHub ↗

minor fixup for Book of the Dead needed in more than one place */

Source from the content-addressed store, hash-verified

722
723/* minor fixup for Book of the Dead needed in more than one place */
724staticfn void
725disco_fmt_uniq(int uidx, char *outbuf)
726{
727 Sprintf(outbuf, " %s", objects[uidx].oc_name_known
728 ? OBJ_NAME(objects[uidx])
729 : OBJ_DESCR(objects[uidx]));
730 /* in the spellbooks section of main discoveries list, encountered
731 but not fully discovered Book of the Dead is shown as
732 "spellbook (papyrus)" like other encountered but not discovered books;
733 in the unique/relics section we want "papyrus spellbook" instead */
734 if (!objects[uidx].oc_name_known
735 && objects[uidx].oc_class == SPBOOK_CLASS)
736 Strcat(outbuf, " spellbook");
737}
738
739/* sort and output sorted_lines to window and free the lines */
740staticfn void

Callers 2

dodiscoveredFunction · 0.85
doclassdiscoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected