fix #H8850 - bless/curse state in perm_invent

Changing an inventory item's bknown flag wasn't followed by a call to
update_inventory() in many circumstances, so information which should
have appeared wasn't showing up until some other event triggered an
update.
This commit is contained in:
PatR
2019-06-04 10:50:24 -07:00
parent ac79fedf60
commit 43afa91ff8
14 changed files with 75 additions and 54 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 pray.c $NHDT-Date: 1549074257 2019/02/02 02:24:17 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.110 $ */
/* NetHack 3.6 pray.c $NHDT-Date: 1559670608 2019/06/04 17:50:08 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.112 $ */
/* Copyright (c) Benson I. Margulies, Mike Stephenson, Steve Linhart, 1989. */
/* NetHack may be freely redistributed. See license for details. */
@@ -499,7 +499,7 @@ int trouble;
what ? what : (const char *) Yobjnam2(otmp, "softly glow"),
hcolor(NH_AMBER));
iflags.last_msg = PLNMSG_OBJ_GLOWS;
otmp->bknown = !Hallucination;
otmp->bknown = !Hallucination; /* ok to skip set_bknown() */
}
uncurse(otmp);
update_inventory();
@@ -558,7 +558,7 @@ int trouble;
otmp = which_armor(u.usteed, W_SADDLE);
if (!Blind) {
pline("%s %s.", Yobjnam2(otmp, "softly glow"), hcolor(NH_AMBER));
otmp->bknown = TRUE;
set_bknown(otmp, 1);
}
uncurse(otmp);
break;
@@ -805,7 +805,7 @@ gcrownu()
make_splbk:
obj = mksobj(class_gift, TRUE, FALSE);
bless(obj);
obj->bknown = TRUE;
obj->bknown = 1; /* ok to skip set_bknown() */
at_your_feet("A spellbook");
dropy(obj);
u.ugifts++;
@@ -892,7 +892,7 @@ gcrownu()
bless(obj);
obj->oeroded = obj->oeroded2 = 0;
obj->oerodeproof = TRUE;
obj->bknown = obj->rknown = TRUE;
obj->bknown = obj->rknown = 1; /* ok to skip set_bknown() */
if (obj->spe < 1)
obj->spe = 1;
/* acquire skill in this weapon */
@@ -1024,7 +1024,7 @@ aligntyp g_align;
You_feel("the power of %s over %s.", u_gname(),
yname(uwep));
uncurse(uwep);
uwep->bknown = TRUE;
uwep->bknown = 1; /* ok to bypass set_bknown() */
*repair_buf = '\0';
} else if (!uwep->blessed) {
if (!Blind) {
@@ -1036,7 +1036,7 @@ aligntyp g_align;
You_feel("the blessing of %s over %s.", u_gname(),
yname(uwep));
bless(uwep);
uwep->bknown = TRUE;
uwep->bknown = 1; /* ok to bypass set_bknown() */
*repair_buf = '\0';
}
@@ -1127,7 +1127,7 @@ aligntyp g_align;
pline("%s %s.", Yobjnam2(otmp, "softly glow"),
hcolor(NH_AMBER));
iflags.last_msg = PLNMSG_OBJ_GLOWS;
otmp->bknown = TRUE;
otmp->bknown = 1; /* ok to bypass set_bknown() */
++any;
}
uncurse(otmp);
@@ -1234,7 +1234,7 @@ boolean bless_water;
&& (bless_water ? !otmp->blessed : !otmp->cursed)) {
otmp->blessed = bless_water;
otmp->cursed = !bless_water;
otmp->bknown = bc_known;
otmp->bknown = bc_known; /* ok to bypass set_bknown() */
changed += otmp->quan;
} else if (otmp->oclass == POTION_CLASS)
other = TRUE;