]> granicus.if.org Git - nethack/commitdiff
fix github issue #155 - encumbrance vs water
authorPatR <rankin@nethack.org>
Sun, 23 Dec 2018 02:09:44 +0000 (18:09 -0800)
committerPatR <rankin@nethack.org>
Sun, 23 Dec 2018 02:09:44 +0000 (18:09 -0800)
Fixes #155

When drowning, you need to be unencumbered in order to crawl out of
water.  When not drowing, you don't, but put a limit on how much can
be carried.  If polymorphed into a swimming creature, allow stressed
or less; otherwise (magical breathing), burdened or less.  (Doesn't
apply on the Plane of Water since there's no climb from water to land
involved.)

doc/fixes36.2
src/hack.c

index c719349ac7fe9cc68b5d9b7ed5ae906bf43bb629..e08f5de5c7ccf4497d651934654ab8943d686c99 100644 (file)
@@ -302,6 +302,7 @@ when fire converts an ice location into a water location, dunk any monster on
 training riding skill had an off-by-one bug when counting turns riding
 message sequencing when vampire shifts to fog cloud to pass under closed door:
        when in sight, give form change message before moving to door spot
+limit carrying heavy loads from water to land
 
 
 Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository
index 362a4c78aef5bc295f4976c609bcb71c3f905f1c..0e3f3f6f221be462dde084e29085ef752182a5a5 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 hack.c  $NHDT-Date: 1544401269 2018/12/10 00:21:09 $  $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.201 $ */
+/* NetHack 3.6 hack.c  $NHDT-Date: 1545530973 2018/12/23 02:09:33 $  $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.202 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Derek S. Ray, 2015. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -1429,6 +1429,19 @@ domove()
             }
             x = u.ux + u.dx;
             y = u.uy + u.dy;
+
+            /* are we trying to move out of water while carrying too much? */
+            if (isok(x, y) && !is_pool(x, y) && !Is_waterlevel(&u.uz)
+                && wtcap > (Swimming ? MOD_ENCUMBER : SLT_ENCUMBER)) {
+                /* when escaping from drowning you need to be unencumbered
+                   in order to crawl out of water, but when not drowning,
+                   doing so while encumbered is feasible; if in an aquatic
+                   form, stressed or less is allowed; otherwise (magical
+                   breathing), only burdened is allowed */
+                You("are carrying too much to climb out of the water.");
+                nomul(0);
+                return;
+            }
         }
         if (!isok(x, y)) {
             nomul(0);
@@ -1441,6 +1454,7 @@ domove()
                 if (iflags.mention_walls) {
                     if (trap && trap->tseen) {
                         int tt = what_trap(trap->ttyp);
+
                         You("stop in front of %s.",
                             an(defsyms[trap_to_defsym(tt)].explanation));
                     } else if (is_pool_or_lava(x,y) && levl[x][y].seenv) {