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

Function simple_look

src/pickup.c:75–98  ·  view source on GitHub ↗

BUG: this lets you look at cockatrice corpses while blind without touching them */ much simpler version of the look-here code; used by query_classes() */

Source from the content-addressed store, hash-verified

73 touching them */
74/* much simpler version of the look-here code; used by query_classes() */
75staticfn void
76simple_look(struct obj *otmp, /* list of objects */
77 boolean here) /* flag for type of obj list linkage */
78{
79 /* Neither of the first two cases is expected to happen, since
80 * we're only called after multiple classes of objects have been
81 * detected, hence multiple objects must be present.
82 */
83 if (!otmp) {
84 impossible("simple_look(null)");
85 } else if (!(here ? otmp->nexthere : otmp->nobj)) {
86 pline1(doname(otmp));
87 } else {
88 winid tmpwin = create_nhwindow(NHW_MENU);
89
90 putstr(tmpwin, 0, "");
91 do {
92 putstr(tmpwin, 0, doname(otmp));
93 otmp = here ? otmp->nexthere : otmp->nobj;
94 } while (otmp);
95 display_nhwindow(tmpwin, TRUE);
96 destroy_nhwindow(tmpwin);
97 }
98}
99
100int
101collect_obj_classes(char ilets[], struct obj *otmp, boolean here,

Callers 1

query_classesFunction · 0.85

Calls 2

donameFunction · 0.85
impossibleFunction · 0.70

Tested by

no test coverage detected