From 43364277458c26cef36766dc3d428fca1c03cc21 Mon Sep 17 00:00:00 2001 From: PatR Date: Tue, 18 Sep 2018 16:30:58 -0700 Subject: [PATCH] fix #H7396 - wishing for "orange" Wishing for "orange" might grant an orange, but it might give an orange gem, orange potion, or orange spellbook instead (but never orange dragon scales or orange dragon scale mail). Force the food object to be an exact match so wishing always produces an orange. --- doc/fixes36.2 | 1 + src/objnam.c | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/fixes36.2 b/doc/fixes36.2 index 4a4fd0fc3..0dbef935b 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -127,6 +127,7 @@ cancelled shapeshifter is no longer able to change shape cancelled shapeshifter hit by polymorph magic will become uncancelled polymorph zap which creates a new long worm (or retains an old one via wizard mode monpolycontrol) can hit that worm multiple times (tail segments) +wishing for "orange" could yield orange or orange colored gem/potion/spellbook Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository diff --git a/src/objnam.c b/src/objnam.c index 0b68f73dc..6588b7f9a 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 objnam.c $NHDT-Date: 1533352036 2018/08/04 03:07:16 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.206 $ */ +/* NetHack 3.6 objnam.c $NHDT-Date: 1537313446 2018/09/18 23:30:46 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.208 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2011. */ /* NetHack may be freely redistributed. See license for details. */ @@ -3204,6 +3204,11 @@ struct obj *no_wish; typ = SPE_BLANK_PAPER; goto typfnd; } + /* specific food rather than color of gem/potion/spellbook[/scales] */ + if (!BSTRCMPI(bp, p - 6, "orange") && mntmp == NON_PM) { + typ = ORANGE; + goto typfnd; + } /* * NOTE: Gold pieces are handled as objects nowadays, and therefore * this section should probably be reconsidered as well as the entire -- 2.40.0