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

Function boxlock_invent

src/zap.c:2686–2702  ·  view source on GitHub ↗

Lock or unlock all boxes in inventory */

Source from the content-addressed store, hash-verified

2684
2685/* Lock or unlock all boxes in inventory */
2686staticfn void
2687boxlock_invent(struct obj *obj)
2688{
2689 struct obj *otmp, *nextobj;
2690 boolean boxing = FALSE;
2691
2692 /* (un)lock carried boxes */
2693 for (otmp = gi.invent; otmp; otmp = nextobj) {
2694 nextobj = otmp->nobj;
2695 if (Is_box(otmp)) {
2696 (void) boxlock(otmp, obj);
2697 boxing = TRUE;
2698 }
2699 }
2700 if (boxing)
2701 update_inventory(); /* in case any box->lknown has changed */
2702}
2703
2704int
2705zapyourself(struct obj *obj, boolean ordinary)

Callers 1

zapyourselfFunction · 0.85

Calls 2

boxlockFunction · 0.85
update_inventoryFunction · 0.85

Tested by

no test coverage detected