MCPcopy Index your code
hub / github.com/NetHack/NetHack / insane_object

Function insane_object

src/mkobj.c:3313–3339  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3311DISABLE_WARNING_FORMAT_NONLITERAL
3312
3313staticfn void
3314insane_object(
3315 struct obj *obj,
3316 const char *fmt,
3317 const char *mesg,
3318 struct monst *mon)
3319{
3320 const char *objnm, *monnm;
3321 char altfmt[BUFSZ];
3322
3323 objnm = monnm = "null!";
3324 if (obj) {
3325 iflags.override_ID++;
3326 objnm = doname(obj);
3327 iflags.override_ID--;
3328 }
3329 if (mon || (strstri(mesg, "minvent") && !strstri(mesg, "contained"))) {
3330 Strcat(strcpy(altfmt, fmt), " held by mon %s (%s)");
3331 if (mon)
3332 monnm = x_monnam(mon, ARTICLE_A, (char *) 0, EXACT_NAME, TRUE);
3333 impossible(altfmt, mesg, fmt_ptr((genericptr_t) obj), where_name(obj),
3334 objnm, fmt_ptr((genericptr_t) mon), monnm);
3335 } else {
3336 impossible(fmt, mesg, fmt_ptr((genericptr_t) obj), where_name(obj),
3337 objnm);
3338 }
3339}
3340
3341RESTORE_WARNING_FORMAT_NONLITERAL
3342

Callers 8

obj_sanity_checkFunction · 0.85
objlist_sanityFunction · 0.85
shop_obj_sanityFunction · 0.85
mon_obj_sanityFunction · 0.85
insane_obj_bitsFunction · 0.85
check_containedFunction · 0.85
check_globFunction · 0.85
sanity_check_wornFunction · 0.85

Calls 5

donameFunction · 0.85
strstriFunction · 0.85
fmt_ptrFunction · 0.85
where_nameFunction · 0.85
impossibleFunction · 0.70

Tested by

no test coverage detected