]> granicus.if.org Git - nethack/commitdiff
Make looting less tedious
authorPasi Kallinen <paxed@alt.org>
Sun, 20 Feb 2022 16:27:23 +0000 (18:27 +0200)
committerPasi Kallinen <paxed@alt.org>
Sun, 20 Feb 2022 16:39:52 +0000 (18:39 +0200)
I've seen complaints how looting containers is tedious, and
since multiple containers in the same location are now (and have
been for a while) handled with a menu, the yes-no-quit prompt
for a single container doesn't really mean anything.

Remove that prompt, and remove the "open carefully" message too,
so when you're looting a location with a single container, the
command will drop straight into the loot-in-out -menu.  Also
adjust one looting message to explicitly mention the container
if there are other objects on top of it.

Removing the prompt means you can't loot a saddle from a tame
monster with plain loot when standing on a container - you need
to prefix the loot command with 'm' prefix in that case.

doc/fixes3-7-0.txt
src/pickup.c

index 1a6d6a43c86026555e22566bfd8ac307cbde1c49..564b86ec9d5913330d9303c06cb5f231ebf3aaae 100644 (file)
@@ -795,6 +795,8 @@ make ravens oviparous
 thrown items can get stuck in webs
 engraving with Fire Brand burns the text on the floor and does not
        dull the artifact
+make looting less tedious by getting rid of a y/n prompt making the command
+       go directly into the loot-in-out -menu
 
 
 Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
index 5d37b04da62977aad73aaa551f3f632afb696b53..d0da3e6672762a6b792a58a35d24a676d46b2c2a 100644 (file)
@@ -1868,7 +1868,7 @@ do_loot_cont(struct obj **cobjp,
     if (cobj->olocked) {
         struct obj *unlocktool;
 
-        if (ccount < 2)
+        if (ccount < 2 && (g.level.objects[cobj->ox][cobj->oy] == cobj))
             pline("%s locked.",
                   cobj->lknown ? "It is" : "Hmmm, it turns out to be");
         else if (cobj->lknown)
@@ -1902,9 +1902,6 @@ do_loot_cont(struct obj **cobjp,
         g.abort_looting = TRUE;
         return ECMD_TIME;
     }
-
-    You("%sopen %s...", (!cobj->cknown || !cobj->lknown) ? "carefully " : "",
-        the(xname(cobj)));
     return use_container(cobjp, 0, (boolean) (cindex < ccount));
 }
 
@@ -1931,7 +1928,6 @@ doloot_core(void)
     boolean underfoot = TRUE;
     const char *dont_find_anything = "don't find anything";
     struct monst *mtmp;
-    char qbuf[BUFSZ];
     int prev_inquiry = 0;
     boolean prev_loot = FALSE;
     int num_conts = 0;
@@ -2022,15 +2018,7 @@ doloot_core(void)
                 nobj = cobj->nexthere;
 
                 if (Is_container(cobj)) {
-                    c = ynq(safe_qbuf(qbuf, "There is ", " here, loot it?",
-                                      cobj, doname, ansimpleoname,
-                                      "a container"));
-                    if (c == 'q')
-                        return (timepassed ? ECMD_TIME : ECMD_OK);
-                    if (c == 'n')
-                        continue;
                     anyfound = TRUE;
-
                     timepassed |= do_loot_cont(&cobj, 1, 1);
                     if (g.abort_looting)
                         /* chest trap or magic bag explosion or <esc> */