getobj callback for object to drink from, which also does double duty as the callback for dipping into (both just allow potions). */
| 502 | /* getobj callback for object to drink from, which also does double duty as |
| 503 | the callback for dipping into (both just allow potions). */ |
| 504 | staticfn int |
| 505 | drink_ok(struct obj *obj) |
| 506 | { |
| 507 | /* getobj()'s callback to test whether hands/self is a valid "item" to |
| 508 | pick is used here to communicate the fact that player has already |
| 509 | passed up an opportunity to perform the action (drink or dip) on a |
| 510 | non-inventory dungeon feature, so if there are no potions in invent |
| 511 | the message will be "you have nothing /else/ to {drink | dip into}"; |
| 512 | if player used 'm' prefix to bypass dungeon features, drink_ok_extra |
| 513 | will be 0 and the potential "else" will be omitted */ |
| 514 | if (!obj) |
| 515 | return drink_ok_extra ? GETOBJ_EXCLUDE_NONINVENT : GETOBJ_EXCLUDE; |
| 516 | |
| 517 | if (obj->oclass == POTION_CLASS) |
| 518 | return GETOBJ_SUGGEST; |
| 519 | |
| 520 | return GETOBJ_EXCLUDE; |
| 521 | } |
| 522 | |
| 523 | /* "Quaffing is like drinking, except you spill more." - Terry Pratchett */ |
| 524 | /* the #quaff command */ |
nothing calls this directly
no outgoing calls
no test coverage detected