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

Function map_monst

src/detect.c:121–134  ·  view source on GitHub ↗

extracted from monster_detection() so can be shared by do_vicinity_map() */

Source from the content-addressed store, hash-verified

119
120/* extracted from monster_detection() so can be shared by do_vicinity_map() */
121staticfn void
122map_monst(struct monst *mtmp, boolean showtail)
123{
124 int glyph = (monsym(mtmp->data) == ' ')
125 ? detected_mon_to_glyph(mtmp, newsym_rn2)
126 : mtmp->mtame
127 ? pet_to_glyph(mtmp, newsym_rn2)
128 : mon_to_glyph(mtmp, newsym_rn2);
129
130 show_glyph(mtmp->mx, mtmp->my, glyph);
131
132 if (showtail && mtmp->data == &mons[PM_LONG_WORM])
133 detect_wsegs(mtmp, 0);
134}
135
136/* this is checking whether a trap symbol represents a trapped chest,
137 not whether a trapped chest is actually present */

Callers 2

monster_detectFunction · 0.85
do_vicinity_mapFunction · 0.85

Calls 2

show_glyphFunction · 0.85
detect_wsegsFunction · 0.85

Tested by

no test coverage detected