getobj callback for object to call (name its type) */
| 477 | |
| 478 | /* getobj callback for object to call (name its type) */ |
| 479 | int |
| 480 | call_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 */ |
| 498 | int |
no test coverage detected