Minor reformat, fix warnings
authorPasi Kallinen <paxed@alt.org>
Thu, 14 Sep 2017 11:40:11 +0000 (14:40 +0300)
committerPasi Kallinen <paxed@alt.org>
Thu, 14 Sep 2017 11:40:11 +0000 (14:40 +0300)
src/detect.c
src/pickup.c

index 86e3159bf29923ae71c024fd1b2fd5087e2ff145..2ba4a968fec792657c55bd905d0534bda9a345f1 100644 (file)
@@ -1571,9 +1571,9 @@ boolean via_warning;
                      Blind ? "to check nearby" : "look close by");
                 display_nhwindow(WIN_MESSAGE, FALSE); /* flush messages */
             }
-            mtmp->mundetected = 0;
-            newsym(x, y);
-            goto find;
+        mtmp->mundetected = 0;
+        newsym(x, y);
+        goto find;
     }
     return 0;
 }
index 1bba6492bf1a5c55851344c2ac9b514691efd05a..56ff922f9f27ec448d4698477273f0e343c2c405 100644 (file)
@@ -2348,13 +2348,18 @@ explain_container_prompt(more_containers)
 boolean more_containers;
 {
     static const char *const explaintext[] = {
-        "Container actions:", "", " : -- Look: examine contents",
-        " o -- Out: take things out", " i -- In: put things in",
+        "Container actions:",
+        "",
+        " : -- Look: examine contents",
+        " o -- Out: take things out",
+        " i -- In: put things in",
         " b -- Both: first take things out, then put things in",
         " r -- Reversed: put things in, then take things out",
         " s -- Stash: put one item in", "",
-        " n -- Next: loot next selected container", " q -- Quit: finished",
-        " ? -- Help: display this text.", "", 0
+        " n -- Next: loot next selected container",
+        " q -- Quit: finished",
+        " ? -- Help: display this text.",
+        "", 0
     };
     const char *const *txtpp;
     winid win;
@@ -2392,7 +2397,7 @@ struct obj **objp;
 int held;
 boolean more_containers; /* True iff #loot multiple and this isn't last one */
 {
-    struct obj *curr, *otmp, *obj = *objp;
+    struct obj *otmp, *obj = *objp;
     boolean quantum_cat, cursed_mbag, loot_out, loot_in, loot_in_first,
         stash_one, inokay, outokay, outmaybe;
     char c, emptymsg[BUFSZ], qbuf[QBUFSZ], pbuf[QBUFSZ], xbuf[QBUFSZ];
@@ -2439,7 +2444,11 @@ boolean more_containers; /* True iff #loot multiple and this isn't last one */
         used = 1;
     }
 
-    if ((loss = boh_loss(current_container, held)) != 0) {
+    cursed_mbag = Is_mbag(current_container)
+        && current_container->cursed
+        && Has_contents(current_container);
+    if (cursed_mbag
+        && (loss = boh_loss(current_container, held)) != 0) {
         used = 1;
         You("owe %ld %s for lost merchandise.", loss, currency(loss));
         current_container->owt = weight(current_container);