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

Function insane_obj_bits

src/mkobj.c:3248–3274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3246}
3247
3248staticfn void
3249insane_obj_bits(struct obj *obj, struct monst *mon)
3250{
3251 unsigned o_in_use, o_bypass, o_nomerge, o_boulder;
3252
3253 if (obj->where == OBJ_DELETED)
3254 return; /* skip bit checking for deleted objects */
3255
3256 o_in_use = obj->in_use;
3257 o_bypass = obj->bypass;
3258 /* having obj->nomerge be set might be intentional */
3259 o_nomerge = (obj->nomerge && !nomerge_exception(obj));
3260 /* next_boulder is only for object name formatting when pushing
3261 boulders and should be reset by time of next sanity check */
3262 o_boulder = (obj->otyp == BOULDER && obj->next_boulder);
3263
3264 if (o_in_use || o_bypass || o_nomerge || o_boulder) {
3265 char infobuf[QBUFSZ];
3266
3267 Sprintf(infobuf, "flagged%s%s%s%s",
3268 o_in_use ? " in_use" : "",
3269 o_bypass ? " bypass" : "",
3270 o_nomerge ? " nomerge" : "",
3271 o_boulder ? " nxtbldr" : "");
3272 insane_object(obj, ofmt0, infobuf, mon);
3273 }
3274}
3275
3276/* does 'obj' use the 'nomerge' flag persistently? */
3277staticfn boolean

Callers 2

objlist_sanityFunction · 0.85
mon_obj_sanityFunction · 0.85

Calls 2

nomerge_exceptionFunction · 0.85
insane_objectFunction · 0.85

Tested by

no test coverage detected