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

Function call_ok

src/do_name.c:479–495  ·  view source on GitHub ↗

getobj callback for object to call (name its type) */

Source from the content-addressed store, hash-verified

477
478/* getobj callback for object to call (name its type) */
479int
480call_ok(struct obj *obj)
481{
482 if (!obj || !objtyp_is_callable(obj->otyp))
483 return GETOBJ_EXCLUDE;
484
485 /* not a likely candidate if not seen yet since naming will fail,
486 or if it has been discovered and doesn't already have a name;
487 when something has been named and then becomes discovered, it
488 remains a likely candidate until player renames it to <space>
489 to remove that no longer needed name */
490 if (!obj->dknown || (objects[obj->otyp].oc_name_known
491 && !objects[obj->otyp].oc_uname))
492 return GETOBJ_DOWNPLAY;
493
494 return GETOBJ_SUGGEST;
495}
496
497/* #call / #name command - player can name monster or object or type of obj */
498int

Callers 3

docallcmdFunction · 0.85
namefloorobjFunction · 0.85

Calls 1

objtyp_is_callableFunction · 0.85

Tested by

no test coverage detected