From 68312f7feb8f359dbfde7c5af69e302d298de13e Mon Sep 17 00:00:00 2001 From: PatR Date: Wed, 13 Mar 2024 12:39:50 -0700 Subject: [PATCH] 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. --- doc/fixes3-7-0.txt | 2 ++ src/trap.c | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index e7e5e7ec6..5695d5946 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -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 diff --git a/src/trap.c b/src/trap.c index 46cf717a8..6a036aee8 100644 --- a/src/trap.c +++ b/src/trap.c @@ -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;