]> granicus.if.org Git - nethack/commitdiff
[lack of] autopickup inside shops
authorPatR <rankin@nethack.org>
Tue, 23 Feb 2021 10:42:28 +0000 (02:42 -0800)
committerPatR <rankin@nethack.org>
Tue, 23 Feb 2021 10:42:28 +0000 (02:42 -0800)
When being inside a shop inhibits autopickup, menion that in ^X
feedback about autopickup.

doc/fixes37.0
src/insight.c

index dcc2d36abbb719bcea1cd59f9fca0825888d80d4..3f32841f205e1fd95f0f2b42680f66667c854188 100644 (file)
@@ -1,4 +1,4 @@
-NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.461 $ $NHDT-Date: 1614074653 2021/02/23 10:04:13 $
+NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.462 $ $NHDT-Date: 1614076940 2021/02/23 10:42:20 $
 
 General Fixes and Modified Features
 -----------------------------------
@@ -386,6 +386,7 @@ when an explosion scatters objects, make any that fly over sinks stop there
 output message when changing fastmove mode while cursor targetting
 messages when Minetown watchmen become angry could report "you see an angry
        guard approaching" even if he was invisible and hero can't see invis
+when autopickup is on but disabled due to being inside a shop, have ^X say so
 
 
 Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
index 7df49eabef60d47bb39cdef2a4cc78805d4048d4..aabde690ba576be27c4033295ebeca33138d7010 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.7 insight.c       $NHDT-Date: 1608115734 2020/12/16 10:48:54 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.23 $ */
+/* NetHack 3.7 insight.c       $NHDT-Date: 1614076940 2021/02/23 10:42:20 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.33 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -614,13 +614,18 @@ basics_enlightenment(int mode UNUSED, int final)
         char ocl[MAXOCLASSES + 1];
 
         Strcpy(buf, "on");
-        oc_to_str(flags.pickup_types, ocl);
-        Sprintf(eos(buf), " for %s%s%s",
-                *ocl ? "'" : "", *ocl ? ocl : "all types", *ocl ? "'" : "");
-        if (flags.pickup_thrown && *ocl) /* *ocl: don't show if 'all types' */
-            Strcat(buf, " plus thrown");
-        if (g.apelist)
-            Strcat(buf, ", with exceptions");
+        if (costly_spot(u.ux, u.uy)) {
+            /* being in a shop inhibits autopickup, even 'pickup_thrown' */
+            Strcat(buf, ", but temporarily disabled while inside the shop");
+        } else {
+            oc_to_str(flags.pickup_types, ocl);
+            Sprintf(eos(buf), " for %s%s%s", *ocl ? "'" : "",
+                    *ocl ? ocl : "all types", *ocl ? "'" : "");
+            if (flags.pickup_thrown && *ocl)
+                Strcat(buf, " plus thrown"); /* show when not 'all types' */
+            if (g.apelist)
+                Strcat(buf, ", with exceptions");
+        }
     } else
         Strcpy(buf, "off");
     enl_msg("Autopickup ", "is ", "was ", buf, "");