horn_of_plenty-to-container #tip
For tipping purposes, a horn of plenty is treated like a container. But using one as the source container in a container-to-container tip wasn't supported. Implement that. Also, #tip was offering carried bags of tricks as candidate containers to tip some other carried container into. Only do that for ones which aren't known to be bags of tricks (so when type not discovered yet, or specific bag not seen yet due to blindness).
This commit is contained in:
11
src/mkobj.c
11
src/mkobj.c
@@ -2547,7 +2547,8 @@ dealloc_obj(struct obj *obj)
|
||||
int
|
||||
hornoplenty(
|
||||
struct obj *horn,
|
||||
boolean tipping) /* caller emptying entire contents; affects shop mesgs */
|
||||
boolean tipping, /* caller emptying entire contents; affects shop mesgs */
|
||||
struct obj *targetbox) /* if non-Null, container to tip into */
|
||||
{
|
||||
int objcount = 0;
|
||||
|
||||
@@ -2597,6 +2598,14 @@ hornoplenty(
|
||||
: "Oops! %s to the floor!",
|
||||
The(aobjnam(obj, "slip")), (char *) 0);
|
||||
nhUse(obj);
|
||||
} else if (targetbox) {
|
||||
add_to_container(targetbox, obj);
|
||||
/* add to container doesn't update the weight */
|
||||
targetbox->owt = weight(targetbox);
|
||||
/* item still in magic horn was weightless; when it's now in
|
||||
a carried container, hero's encumbrance could change */
|
||||
if (carried(targetbox))
|
||||
(void) encumber_msg();
|
||||
} else {
|
||||
/* assumes this is taking place at hero's location */
|
||||
if (!can_reach_floor(TRUE)) {
|
||||
|
||||
Reference in New Issue
Block a user