call hold_another_object() to deal with a transformed potion; its weight won't have changed but it might require an extra slot that isn't available or it might merge into some other carried stack */
| 2240 | won't have changed but it might require an extra slot that isn't available |
| 2241 | or it might merge into some other carried stack */ |
| 2242 | staticfn void |
| 2243 | hold_potion( |
| 2244 | struct obj *potobj, |
| 2245 | const char *drop_fmt, const char *drop_arg, |
| 2246 | const char *hold_msg) |
| 2247 | { |
| 2248 | int cap = near_capacity(), |
| 2249 | save_pickup_burden = flags.pickup_burden; |
| 2250 | |
| 2251 | /* prevent a drop due to current setting of the 'pickup_burden' option */ |
| 2252 | if (flags.pickup_burden < cap) |
| 2253 | flags.pickup_burden = cap; |
| 2254 | /* remove from inventory after calculating near_capacity() */ |
| 2255 | obj_extract_self(potobj); |
| 2256 | /* re-insert into inventory, possibly merging with compatible stack */ |
| 2257 | potobj = hold_another_object(potobj, drop_fmt, drop_arg, hold_msg); |
| 2258 | nhUse(potobj); |
| 2259 | flags.pickup_burden = save_pickup_burden; |
| 2260 | update_inventory(); |
| 2261 | return; |
| 2262 | } |
| 2263 | |
| 2264 | /* #dip command - get item to dip, then get potion to dip it into; |
| 2265 | precede with 'm' to bypass fountain, pool, or sink at hero's spot */ |
no test coverage detected