]> granicus.if.org Git - nethack/commitdiff
fix #H1803 - levitating at floor level...
authornethack.rankin <nethack.rankin>
Sun, 1 Feb 2009 00:56:50 +0000 (00:56 +0000)
committernethack.rankin <nethack.rankin>
Sun, 1 Feb 2009 00:56:50 +0000 (00:56 +0000)
     From a bug report, being stuck in the
floor or in lava and trying to move downwards while levitating gave "you
are floating high above the floor/lava" which contradicts being stuck.
Now you'll get "you are trapped in the floor/lava" in that situation.
I thought about letting it fall through to the chance to autodig with
wielded pick, but decided to go with just the alternate message.  (Being
tethered to a buried iron ball still lets you "float high above the floor",
so this doesn't check for being trapped that way.)

doc/fixes34.4
src/do.c
src/fountain.c

index 7e6c7f494c7b4ebd9daf30073e4d5ed6fec0369b..8587de8d019f828c37151204e01fe227910cc004 100644 (file)
@@ -376,6 +376,8 @@ ensure current_fruit gets set to the correct index when setting fruit
 monsters already wearing suits can't put on shirts
 if life-saved steed became untame, repeated "placing steed onto map?" warnings
        would be given as long as the hero remained mounted
+trying to move down while levitating said "you are floating high above floor"
+       even when being stuck in floor or lava blocked full levitation
 
 
 Platform- and/or Interface-Specific Fixes
index 5daf920241a1364ddf25aec2f7dbf1fb0b936b70..56b990be6ae92710c8b6f98044529fb44cbeeea8 100644 (file)
--- a/src/do.c
+++ b/src/do.c
@@ -764,11 +764,10 @@ dodown()
 
                    for(obj = invent; obj; obj = obj->nobj) {
                        if (obj->oartifact &&
-                                       artifact_has_invprop(obj,LEVITATION)) {
+                               artifact_has_invprop(obj, LEVITATION)) {
                            if (obj->age < monstermoves)
-                               obj->age = monstermoves + rnz(100);
-                           else
-                               obj->age += rnz(100);
+                               obj->age = monstermoves;
+                           obj->age += rnz(100);
                        }
                    }
                }
index 51857f25307698124a2ea6c844f724a231166163..d6969d4cebd49a1f62d44156c816cfcde3a8aad8 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)fountain.c 3.5     2008/01/19      */
+/*     SCCS Id: @(#)fountain.c 3.5     2009/01/31      */
 /*     Copyright Scott R. Turner, srt@ucla, 10/27/86 */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -12,11 +12,21 @@ STATIC_DCL void NDECL(dowaternymph);
 STATIC_PTR void FDECL(gush, (int,int,genericptr_t));
 STATIC_DCL void NDECL(dofindgem);
 
+/* used when trying to dip in or drink from fountain or sink or pool while
+   levitating above it, or when trying to move downwards in that state */
 void
 floating_above(what)
 const char *what;
 {
-    You("are floating high above the %s.", what);
+    const char *umsg = "are floating high above the %s.";
+
+    if (u.utrap && (u.utraptype == TT_INFLOOR || u.utraptype == TT_LAVA)) {
+       /* when stuck in floor (not possible at fountain or sink location,
+          so must be attempting to move down), override the usual message */
+       umsg = "are trapped in the %s.";
+       what = surface(u.ux, u.uy);     /* probably redundant */
+    }
+    You(umsg, what);
 }
 
 STATIC_OVL void