object bypass bit sanity for container contents
Noticed when adding a 'tip container' choice to item-actions for context sensitive inventory (update pending). Putting items into a container with menustyle traditional and then takiing them out with the #tip command while 'sanity_check' is On would produce warnings once they were on the floor. askchain() uses object bypassing to be able to cope with multi-drop potentially changing invent, and it tried to reset that when done. But it did so with the original object list (invent in this case) and that doesn't reset individual objects that have been moved to any other list. The between-turn resetting of bypass bits wasn't doing so for container contents. The sanity check wasn't--still isn't--checking those either, so it wasn't noticeable while items were still inside the container. But taking them out with #tip doesn't touch any bypass bits, so between-turn reset isn't triggered and the items that came out of the container with bypass set continued to have it set while on floor. sanity_check complained. Change clear_bypasses() to handle container contents, and change askchain() to call it instead of just clearing bypasses for whatever is left of its input chain. (The latter probably isn't necessary now that the between-turn cleanup deals with contents.)
This commit is contained in:
11
src/pickup.c
11
src/pickup.c
@@ -2697,10 +2697,10 @@ stash_ok(struct obj *obj)
|
||||
}
|
||||
|
||||
int
|
||||
use_container(struct obj **objp,
|
||||
int held,
|
||||
boolean more_containers) /* True iff #loot multiple and this
|
||||
isn't last one */
|
||||
use_container(
|
||||
struct obj **objp,
|
||||
int held,
|
||||
boolean more_containers) /* True iff #loot multiple and this isn't last */
|
||||
{
|
||||
struct obj *otmp, *obj = *objp;
|
||||
boolean quantum_cat, cursed_mbag, loot_out, loot_in, loot_in_first,
|
||||
@@ -2817,7 +2817,8 @@ use_container(struct obj **objp,
|
||||
} else {
|
||||
c = in_or_out_menu(qbuf, g.current_container,
|
||||
outmaybe, inokay,
|
||||
(boolean) (used != ECMD_OK), more_containers);
|
||||
(boolean) (used != ECMD_OK),
|
||||
more_containers);
|
||||
}
|
||||
} else { /* TRADITIONAL or COMBINATION */
|
||||
xbuf[0] = '\0'; /* list of extra acceptable responses */
|
||||
|
||||
Reference in New Issue
Block a user