From 2c3b9d1d2d0cf94552347495ddf68f4367c29386 Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 9 Jul 2021 19:40:52 -0700 Subject: [PATCH] wishing for "paperback book" Something I noticed recently: a wish request for "paperback book" yielded "Nothing fitting that description exists in the game." Asking for "paperback spellbook" worked though. I'm not sure whether this is the best way to handle this particular exception but wishing for "paperback book" now works. --- doc/fixes37.0 | 4 +++- src/objnam.c | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/doc/fixes37.0 b/doc/fixes37.0 index 7393d29ba..8b0ecef2e 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -1,4 +1,4 @@ -NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.586 $ $NHDT-Date: 1625838646 2021/07/09 13:50:46 $ +NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.588 $ $NHDT-Date: 1625884843 2021/07/10 02:40:43 $ General Fixes and Modified Features ----------------------------------- @@ -560,6 +560,8 @@ allow using rush/run prefix key in getloc to fastmove the cursor avoid "it" in messages "Wait! There's an it hiding under !" (hero moving) and "It was hidden under !" (unseen monster moving) don't extinguish burning objects when engulfed by a fire vortex +allow wishing for a novel via description "paperback book" (previously only + worked when specifying "paperback spellbook") Fixes to 3.7.0-x Problems that Were Exposed Via git Repository diff --git a/src/objnam.c b/src/objnam.c index 9454e042a..8fa14f3f6 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 objnam.c $NHDT-Date: 1620348711 2021/05/07 00:51:51 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.315 $ */ +/* NetHack 3.7 objnam.c $NHDT-Date: 1625884843 2021/07/10 02:40:43 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.324 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2011. */ /* NetHack may be freely redistributed. See license for details. */ @@ -3826,6 +3826,12 @@ readobjnam_postparse1(struct _readobjnam_data *d) d->typ = SPE_BLANK_PAPER; return 2; /*goto typfnd;*/ } + /* without this, player would need to specify "paperback spellbook" to + get a novel using its description */ + if (!BSTRCMPI(d->bp, d->p - 14, "paperback book")) { + d->typ = SPE_NOVEL; + return 2; /*goto typfnd;*/ + } /* specific food rather than color of gem/potion/spellbook[/scales] */ if (!BSTRCMPI(d->bp, d->p - 6, "orange") && d->mntmp == NON_PM) { d->typ = ORANGE;