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

Function grease_ok

src/apply.c:2584–2601  ·  view source on GitHub ↗

getobj callback for object to apply grease to */

Source from the content-addressed store, hash-verified

2582
2583/* getobj callback for object to apply grease to */
2584staticfn int
2585grease_ok(struct obj *obj)
2586{
2587 if (!obj)
2588 return GETOBJ_SUGGEST;
2589
2590 /* note: if changing the list of ungreasable objects, also change
2591 special_throne_effect in sit.c */
2592 if (obj->oclass == COIN_CLASS)
2593 return GETOBJ_EXCLUDE;
2594
2595 if (inaccessible_equipment(obj, (const char *) 0, FALSE))
2596 return GETOBJ_EXCLUDE_INACCESS;
2597
2598 /* Possible extension: don't suggest greasing objects which are already
2599 * greased. */
2600 return GETOBJ_SUGGEST;
2601}
2602
2603staticfn int
2604use_grease(struct obj *obj)

Callers

nothing calls this directly

Calls 1

inaccessible_equipmentFunction · 0.85

Tested by

no test coverage detected