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

Function unknow_object

src/mkobj.c:853–865  ·  view source on GitHub ↗

some init for a brand new object, or partial re-init when hero loses potentially known info about an object (called when an unseen monster picks up or uses it); moved from invent.c to here for access to dknowns */

Source from the content-addressed store, hash-verified

851 potentially known info about an object (called when an unseen monster
852 picks up or uses it); moved from invent.c to here for access to dknowns */
853void
854unknow_object(struct obj *obj)
855{
856 clear_dknown(obj); /* obj->dknown = 0; */
857
858 obj->bknown = obj->rknown = 0;
859 obj->cknown = obj->lknown = 0;
860 obj->tknown = 0;
861 /* for an existing object, awareness of charges or enchantment has
862 gone poof... [object types which don't use the known flag have
863 it set True for some reason] */
864 obj->known = objects[obj->otyp].oc_uses_known ? 0 : 1;
865}
866
867/* do some initialization to newly created object; otyp must already be set */
868staticfn void

Callers 4

mpickobjFunction · 0.85
mksobjFunction · 0.85
mzapwandFunction · 0.85
mplayhornFunction · 0.85

Calls 1

clear_dknownFunction · 0.85

Tested by

no test coverage detected