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

Function learn_unseen_invent

src/invent.c:2749–2775  ·  view source on GitHub ↗

called when regaining sight; mark inventory objects which were picked up while blind as now having been seen */

Source from the content-addressed store, hash-verified

2747/* called when regaining sight; mark inventory objects which were picked
2748 up while blind as now having been seen */
2749void
2750learn_unseen_invent(void)
2751{
2752 struct obj *otmp;
2753 boolean invupdated = FALSE;
2754
2755 if (Blind)
2756 return; /* sanity check */
2757
2758 for (otmp = gi.invent; otmp; otmp = otmp->nobj) {
2759 if (otmp->dknown && (otmp->bknown || !Role_if(PM_CLERIC)) &&
2760 (otmp->oclass != SCROLL_CLASS || !Role_if(PM_ARCHEOLOGIST)))
2761 continue; /* already seen */
2762 invupdated = TRUE;
2763 /* xname() will set dknown, perhaps bknown (for priest[ess]);
2764 result from xname() is immediately released for re-use */
2765 maybereleaseobuf(xname(otmp));
2766 addinv_core2(otmp); /* you react to seeing the object */
2767
2768 /*
2769 * If object->eknown gets implemented (see learnwand(zap.c)),
2770 * handle deferred discovery here.
2771 */
2772 }
2773 if (invupdated)
2774 update_inventory();
2775}
2776
2777/* persistent inventory window is maintained by interface code;
2778 'update_inventory' used to be a macro for

Callers 2

drawWornMethod · 0.85
toggle_blindnessFunction · 0.85

Calls 4

maybereleaseobufFunction · 0.85
xnameFunction · 0.85
addinv_core2Function · 0.85
update_inventoryFunction · 0.85

Tested by

no test coverage detected