]> granicus.if.org Git - nethack/commitdiff
still more levitation blocking (trunk only)
authornethack.rankin <nethack.rankin>
Sun, 23 Oct 2011 00:37:55 +0000 (00:37 +0000)
committernethack.rankin <nethack.rankin>
Sun, 23 Oct 2011 00:37:55 +0000 (00:37 +0000)
     Removing ring or boots of levitation while stuck in solid rock was
silent as intended, but timeout of potion or spell said "you float gently
to the ground" even though there's no actual movement.

     Using '>' command while in solid rock said "you can't go down here"
without attempting to toggle off controlled levitation.

src/do.c
src/trap.c

index 93b08b5fd5a16bc1af0edaa533c21d30eda148ac..841cc0592acf3d5424e3e902158f834e7da14ad2 100644 (file)
--- a/src/do.c
+++ b/src/do.c
@@ -756,7 +756,9 @@ dodown()
            return 0;
        }
 #endif
-       if (Levitation) {
+       /* Levitation might be blocked, but player can still use '>' to
+          turn off controlled levitaiton */
+       if (HLevitation || ELevitation) {
            if ((HLevitation & I_SPECIAL) || (ELevitation & W_ARTI)) {
                /* end controlled levitation */
                if (ELevitation & W_ARTI) {
@@ -771,10 +773,16 @@ dodown()
                        }
                    }
                }
-               if (float_down(I_SPECIAL|TIMEOUT, W_ARTI))
-                   return (1);   /* came down, so moved */
+               if (float_down(I_SPECIAL|TIMEOUT, W_ARTI)) {
+                   return 1;   /* came down, so moved */
+               } else if (!HLevitation && !ELevitation) {
+                   Your("latent levitation ceases.");
+                   return 1;   /* did something, effectively moved */
+               }
            }
-           if (Blind) {
+           if (BLevitation) {
+               ;       /* weren't actually floating after all */
+           } else if (Blind) {
                /* Avoid alerting player to an unknown stair or ladder.
                 * Changes the message for a covered, known staircase
                 * too; staircase knowledge is not stored anywhere.
index 0982cb7de3a88e2b989d420df910321ec85e97d1..d3d2334bafc938bc496eac804354b262cd52e8cb 100644 (file)
@@ -2669,7 +2669,13 @@ long hmask, emask;     /* might cancel timeout */
 
        HLevitation &= ~hmask;
        ELevitation &= ~emask;
-       if(Levitation) return(0); /* maybe another ring/potion/boots */
+       if (Levitation) return 0; /* maybe another ring/potion/boots */
+       if (BLevitation) {
+           /* Levitation is blocked, so hero is not actually floating
+              hence shouldn't have float_down effects and feedback */
+           float_vs_flight(); /* before nomul() rather than after */
+           return 0;
+       }
        nomul(0);       /* stop running or resting */
        if (BFlying) {
            /* controlled flight no longer overridden by levitation */