perm_invent update when applying a bag of tricks

This commit is contained in:
Pasi Kallinen
2022-01-09 16:40:35 +02:00
parent 3583fd517e
commit a990eae8ec

View File

@@ -2326,8 +2326,10 @@ bagotricks(struct obj *bag,
/* if tipping known empty bag, give normal empty container message */
pline1((tipping && bag->cknown) ? "It's empty." : nothing_happens);
/* now known to be empty if sufficiently discovered */
if (bag->dknown && objects[bag->otyp].oc_name_known)
if (bag->dknown && objects[bag->otyp].oc_name_known) {
bag->cknown = 1;
update_inventory(); /* for perm_invent */
}
} else {
struct monst *mtmp;
int creatcnt = 1, seecount = 0;
@@ -2349,8 +2351,10 @@ bagotricks(struct obj *bag,
if (seecount) {
if (seencount)
*seencount += seecount;
if (bag->dknown)
if (bag->dknown) {
makeknown(BAG_OF_TRICKS);
update_inventory(); /* for perm_invent */
}
} else if (!tipping) {
pline1(!moncount ? nothing_happens : "Nothing seems to happen.");
}