]> granicus.if.org Git - nethack/commitdiff
followup: drinking from sinks while levitating
authorcohrs <cohrs>
Tue, 11 Jan 2005 19:47:37 +0000 (19:47 +0000)
committercohrs <cohrs>
Tue, 11 Jan 2005 19:47:37 +0000 (19:47 +0000)
This is a followup to the patch I made a couple months ago.  It replaces
the "!Levitation && !u.uswallow" checks with can_reach_floor(), which
makes a more complete set of checks and is more consistent.  I applied
this to fountains too.  I doubt that fountains hit the ceiling, and the
checks also seem reasonable for heights in between (e.g. while mounted).

src/potion.c

index 05afbd7bf954f591358a9bc86f03fe21ff07a13f..5bb61f14bf7f421c8b3e9bd8be7dac759ac1dd23 100644 (file)
@@ -342,7 +342,7 @@ dodrink()
                return 0;
        }
        /* Is there a fountain to drink from here? */
-       if (IS_FOUNTAIN(levl[u.ux][u.uy].typ) && !Levitation && !u.uswallow) {
+       if (IS_FOUNTAIN(levl[u.ux][u.uy].typ) && can_reach_floor()) {
                if(yn("Drink from the fountain?") == 'y') {
                        drinkfountain();
                        return 1;
@@ -350,7 +350,7 @@ dodrink()
        }
 #ifdef SINKS
        /* Or a kitchen sink? */
-       if (IS_SINK(levl[u.ux][u.uy].typ) && !Levitation && !u.uswallow) {
+       if (IS_SINK(levl[u.ux][u.uy].typ) && can_reach_floor()) {
                if (yn("Drink from the sink?") == 'y') {
                        drinksink();
                        return 1;