]> granicus.if.org Git - nethack/commitdiff
data.base lookup bit
authorPatR <rankin@nethack.org>
Fri, 21 Dec 2018 02:58:44 +0000 (18:58 -0800)
committerPatR <rankin@nethack.org>
Fri, 21 Dec 2018 02:58:44 +0000 (18:58 -0800)
When testing the change to the Eyes of the Overworld wording and asking
for information about inventory item
 k - a pair of lenses named The Eyes of the Overworld
I got "I don't have any information on those things".  Not because that
item wasn't identified, but because the lookup was for "pair of lenses"
(finding nothing) and then for "The Eyes of the Overworld" (and not
finding it due to "The" which is stripped from the first attempt but
wasn't from the second nor present in the data.base key).

doc/fixes36.2
src/pager.c

index b4437d63a34fa13b441250a350acc2b78af5464b..b080b417d9038f8c28fccff7e3b15955c4698d2e 100644 (file)
@@ -293,6 +293,8 @@ vibrating square is not really a trap so monsters don't need to avoid it
 if hero kicks some embedded gold out of a wall while following vault gaurd
        away from vault, don't report "the guard _calms_down_and_ picks up
        the gold" unless he's on brink of going ballistic
+for '/?' information lookup, "item named The Artifact" failed to find info
+       about "Artifact" due to presence of "The"
 
 
 Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository
index 6982860c988b2ef4fa6978442e5bf07643e6bd0b..f15c40f590f4b2665e20775074d533f999d69fe5 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 pager.c $NHDT-Date: 1545129848 2018/12/18 10:44:08 $  $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.142 $ */
+/* NetHack 3.6 pager.c $NHDT-Date: 1545361111 2018/12/21 02:58:31 $  $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.143 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Robert Patrick Rankin, 2018. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -576,6 +576,8 @@ char *supplemental_name;
         if (*dbase_str == ' ')
             ++dbase_str;
     }
+    if (!strncmp(dbase_str, "pair of ", 8))
+        dbase_str += 8;
     if (!strncmp(dbase_str, "tame ", 5))
         dbase_str += 5;
     else if (!strncmp(dbase_str, "peaceful ", 9))
@@ -640,6 +642,14 @@ char *supplemental_name;
             ep = strstri(dbase_str, ", ");
         if (ep && ep > dbase_str)
             *ep = '\0';
+        /* remove article from 'alt' name ("a pair of lenses named
+           The Eyes of the Overworld" simplified above to "lenses named
+           The Eyes of the Overworld", now reduced to "The Eyes of the
+           Overworld", skip "The" as with base name processing) */
+        if (!strncmpi(alt, "a ", 2)
+            || !strncmpi(alt, "an ", 3)
+            || !strncmpi(alt, "the ", 4))
+            alt = index(alt, ' ') + 1;
         /* remove charges or "(lit)" or wizmode "(N aum)" */
         if ((ep = strstri(dbase_str, " (")) != 0 && ep > dbase_str)
             *ep = '\0';