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

Function check_here

src/pickup.c:429–456  ·  view source on GitHub ↗

look at the objects at our location, unless there are too many of them */

Source from the content-addressed store, hash-verified

427
428/* look at the objects at our location, unless there are too many of them */
429staticfn void
430check_here(boolean picked_some)
431{
432 struct obj *obj;
433 int ct = 0;
434 unsigned lhflags = picked_some ? LOOKHERE_PICKED_SOME : LOOKHERE_NOFLAGS;
435
436 if (flags.mention_decor) {
437 if (describe_decor())
438 lhflags |= LOOKHERE_SKIP_DFEATURE;
439 }
440
441 /* count the objects here */
442 for (obj = svl.level.objects[u.ux][u.uy]; obj; obj = obj->nexthere) {
443 if (obj != uchain)
444 ct++;
445 }
446
447 /* If there are objects here, take a look. */
448 if (ct) {
449 if (svc.context.run)
450 nomul(0);
451 flush_screen(1);
452 (void) look_here(ct, lhflags);
453 } else {
454 read_engr_at(u.ux, u.uy);
455 }
456}
457
458/* query_objlist callback: return TRUE if obj's count is >= reference value */
459staticfn boolean

Callers 1

pickupFunction · 0.85

Calls 5

describe_decorFunction · 0.85
nomulFunction · 0.85
flush_screenFunction · 0.85
look_hereFunction · 0.85
read_engr_atFunction · 0.85

Tested by

no test coverage detected