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

Function is_inuse

src/invent.c:2166–2170  ·  view source on GitHub ↗

is 'obj' being used by the hero? worn, wielded, active lamp or leash; not to be confused with obj->in_use, which finishes using up an item (destroys it) if restoring a save file finds that bit set */

Source from the content-addressed store, hash-verified

2164 not to be confused with obj->in_use, which finishes using up an item
2165 (destroys it) if restoring a save file finds that bit set */
2166boolean
2167is_inuse(struct obj *obj)
2168{
2169 return (carried(obj) && (is_worn(obj) || tool_being_used(obj)));
2170}
2171
2172/* extra xprname() input that askchain() can't pass through safe_qbuf() */
2173static struct xprnctx {

Callers 1

doprinuseFunction · 0.85

Calls 2

is_wornFunction · 0.85
tool_being_usedFunction · 0.85

Tested by

no test coverage detected