magic trap uncursing vs scroll of remove curse

Reported directly to devteam:  if a magic trap gave its uncurse
effect, scroll of remove curse could become discovered.

Turns out that it would happen if hero was wielding a stack of
unholy water potions.  It didn't matter whether they were known
as water or known to be cursed or whether hero was carrying any
scrolls of remove curse.
This commit is contained in:
PatR
2024-03-13 12:39:50 -07:00
parent a13b9da286
commit 68312f7feb
2 changed files with 7 additions and 3 deletions

View File

@@ -1890,6 +1890,8 @@ for OPTIONS=symset:blank, S_engroom (engraving on a room floor spot) and
setting perm_invent in RC file before setting windowtype (whether later in
that file or via NETHACKOPTIONS) could result in it staying False
depending upon whether the default windowtype supported it
if hero was wielding potion(s) of unholy water and a magic trap gave its
remove curse effect, scroll of remove curse would become discovered
Fixes to 3.7.0-x Platform and/or Interface Problems Exposed Via git Repository

View File

@@ -4236,9 +4236,11 @@ domagictrap(void)
struct obj pseudo;
long save_conf = HConfusion;
pseudo = cg.zeroobj; /* neither cursed nor blessed,
and zero out oextra */
pseudo.otyp = SCR_REMOVE_CURSE;
pseudo = cg.zeroobj; /* force 'uncursed' and zero out oextra */
/* used to be SCR_REMOVE_CURSE but that could cause seffects()
to have hero discover scroll of remove curse */
pseudo.otyp = SPE_REMOVE_CURSE;
pseudo.oclass = SPBOOK_CLASS;
HConfusion = 0L;
(void) seffects(&pseudo);
HConfusion = save_conf;