]> granicus.if.org Git - nethack/commitdiff
Fix cursed scroll of light on the rogue level
authorPasi Kallinen <paxed@alt.org>
Fri, 9 Oct 2015 05:00:43 +0000 (08:00 +0300)
committerPasi Kallinen <paxed@alt.org>
Fri, 9 Oct 2015 05:00:47 +0000 (08:00 +0300)
Being blind and engulfed, reading cursed scroll of light did still darken
the room on the Rogue level.  This also changes the logic a bit, so that
cursed scroll of light will douse lamps in your inventory, even when
swallowed.

src/read.c

index 20bffa9755ca49488d8f97b11aca67febcb65814..92e34c24cda9faf57884ae79ada7dc191e4b6143 100644 (file)
@@ -1816,13 +1816,13 @@ struct obj *obj;
         if (!Blind) {
             if (u.uswallow) {
                 pline("It seems even darker in here than before.");
-                return;
+            } else {
+                if (uwep && artifact_light(uwep) && uwep->lamplit)
+                    pline("Suddenly, the only light left comes from %s!",
+                          the(xname(uwep)));
+                else
+                    You("are surrounded by darkness!");
             }
-            if (uwep && artifact_light(uwep) && uwep->lamplit)
-                pline("Suddenly, the only light left comes from %s!",
-                      the(xname(uwep)));
-            else
-                You("are surrounded by darkness!");
         }
 
         /* the magic douses lamps, et al, too */
@@ -1840,14 +1840,12 @@ struct obj *obj;
                 pline("%s shines briefly.", Monnam(u.ustuck));
             else
                 pline("%s glistens.", Monnam(u.ustuck));
-            return;
-        }
-        if (!Blind)
+        } else if (!Blind)
             pline("A lit field surrounds you!");
     }
 
-    /* No-op in water - can only see the adjacent squares and that's it! */
-    if (Underwater || Is_waterlevel(&u.uz))
+    /* No-op when swallowed or in water */
+    if (u.uswallow || Underwater || Is_waterlevel(&u.uz))
         return;
     /*
      *  If we are darkening the room and the hero is punished but not