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

Function objdescr_is

src/o_init.c:351–365  ·  view source on GitHub ↗

Return TRUE if the provided string matches the unidentified description of * the provided object. */

Source from the content-addressed store, hash-verified

349/* Return TRUE if the provided string matches the unidentified description of
350 * the provided object. */
351boolean
352objdescr_is(struct obj *obj, const char *descr)
353{
354 const char *objdescr;
355
356 if (!obj) {
357 impossible("objdescr_is: null obj");
358 return FALSE;
359 }
360
361 objdescr = OBJ_DESCR(objects[obj->otyp]);
362 if (!objdescr)
363 return FALSE; /* no obj description, no match */
364 return !strcmp(objdescr, descr);
365}
366
367/* level dependent initialization */
368void

Callers 9

can_blndFunction · 0.85
dodrinkFunction · 0.85
use_saddleFunction · 0.85
slippery_ice_fumblingFunction · 0.85
eatspecialFunction · 0.85
meatobjFunction · 0.85
study_bookFunction · 0.85
precheckFunction · 0.85
do_break_wandFunction · 0.85

Calls 1

impossibleFunction · 0.70

Tested by

no test coverage detected