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

Function clear_dknown

src/mkobj.c:834–848  ·  view source on GitHub ↗

set obj->dknown to 0 for most types of objects, to 1 otherwise; split off from unknow_object() */

Source from the content-addressed store, hash-verified

832/* set obj->dknown to 0 for most types of objects, to 1 otherwise;
833 split off from unknow_object() */
834void
835clear_dknown(struct obj *obj)
836{
837 /* note: this is an unobserving not an observing, so don't call
838 observe_object even if dknown is being set to 1 */
839 obj->dknown = strchr(dknowns, obj->oclass) ? 0 : 1;
840 if ((obj->otyp >= ELVEN_SHIELD && obj->otyp <= ORCISH_SHIELD)
841 || obj->otyp == SHIELD_OF_REFLECTION
842 || objects[obj->otyp].oc_merge)
843 obj->dknown = 0;
844 /* globs always have dknown flag set (to maximize merging) but for new
845 object, globby flag won't be set yet so isn't available to check */
846 if (Is_pudding(obj))
847 obj->dknown = 1;
848}
849
850/* some init for a brand new object, or partial re-init when hero loses
851 potentially known info about an object (called when an unseen monster

Callers 3

make_corpseFunction · 0.85
unknow_objectFunction · 0.85
mthrowu.cFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected