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

Function tool_being_used

src/invent.c:4697–4711  ·  view source on GitHub ↗

is 'obj' a tool that's in use? can't simply check obj->owornmask */

Source from the content-addressed store, hash-verified

4695
4696/* is 'obj' a tool that's in use? can't simply check obj->owornmask */
4697staticfn boolean
4698tool_being_used(struct obj *obj)
4699{
4700 /*
4701 * [Should this also include lit potions of oil? They're not tools
4702 * but they are "in use" without being noticeable via obj->owornmask.]
4703 */
4704 if ((obj->owornmask & (W_TOOL | W_SADDLE)) != 0L)
4705 return TRUE;
4706 if (obj->oclass != TOOL_CLASS)
4707 return FALSE;
4708 /* [don't actually need to check uwep here; caller catches it] */
4709 return (boolean) (obj == uwep || obj->lamplit
4710 || (obj->otyp == LEASH && obj->leashmon));
4711}
4712
4713/* the #seetools command */
4714int

Callers 2

is_inuseFunction · 0.85
doprtoolFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected