auto-cursing helmet vs perm_invent

I though that I noticed a problem but later couldn't reproduce
it, so this might not be redundant.  Update persistent inventory
when putting on a helmet causes it to become cursed.

Minor change:  if blind at the time, hero loses knowledge of BUC
state.
This commit is contained in:
PatR
2020-11-16 18:08:02 -08:00
parent d81e1672aa
commit 98075ebfe8
2 changed files with 11 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 do_wear.c $NHDT-Date: 1598958650 2020/09/01 11:10:50 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.135 $ */
/* NetHack 3.7 do_wear.c $NHDT-Date: 1605578866 2020/11/17 02:07:46 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.136 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
@@ -424,6 +424,14 @@ Helmet_on(VOID_ARGS)
pline("%s %s for a moment.", Tobjnam(uarmh, "glow"),
hcolor(NH_BLACK));
curse(uarmh);
/* curse() doesn't touch bknown so doesn't update persistent
inventory; do so now [set_bknown() calls update_inventory()] */
if (Blind)
set_bknown(uarmh, 0); /* lose bknown if previously set */
else if (Role_if(PM_PRIEST))
set_bknown(uarmh, 1); /* (bknown should already be set) */
else if (uarmh->bknown)
update_inventory(); /* keep bknown as-is; display the curse */
}
g.context.botl = 1; /* reveal new alignment or INT & WIS */
if (Hallucination) {