]> granicus.if.org Git - nethack/commitdiff
fix H2766 - jumping while punished could leave ball in wrong place
authorDavid Cohrs <davecohrs@gmail.com>
Wed, 10 Feb 2016 21:47:43 +0000 (13:47 -0800)
committerDavid Cohrs <davecohrs@gmail.com>
Wed, 10 Feb 2016 21:47:43 +0000 (13:47 -0800)
Affected both intrinsic and spell-based jumping.
hurtle_step now drags the ball.

doc/fixes36.1
src/apply.c
src/dothrow.c
src/teleport.c

index 7a2467d09868a465b3cf20ad91027a06abc91ef1..1d53499b396ef6c73aa067a0c187c0f49502c0ca 100644 (file)
@@ -151,6 +151,7 @@ when two or more shopkeepers were visible at once, 'p' command could be used
 vortexes and other unsolid monsters need not avoid webs
 barbarian and samurai can achieve basic in their special spell's skill
 scalpel and tsurugi can now split puddings; bashing with darts or arrows can't
+jumping while punished could leave ball and chain in the wrong place
 
 
 Platform- and/or Interface-Specific Fixes
index 339f7f6d070744026faecd78c679981e84fe9ee0..e993db8344bc26ccd568721977a3d7f227cc548d 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 apply.c $NHDT-Date: 1452660177 2016/01/13 04:42:57 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.219 $ */
+/* NetHack 3.6 apply.c $NHDT-Date: 1455140802 2016/02/10 21:46:42 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.220 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -1645,7 +1645,11 @@ int magic; /* 0=Physical, otherwise skill level */
         if (range < temp)
             range = temp;
         (void) walk_path(&uc, &cc, hurtle_step, (genericptr_t) &range);
-        teleds(cc.x, cc.y, TRUE);
+        /* hurtle_step results in (u.ux, u.uy) == (cc.x, cc.y) and usually
+         * moves the ball if punished, but does not handle all the effects
+         * of landing on the final position.
+         */
+        teleds(cc.x, cc.y, FALSE);
         sokoban_guilt();
         nomul(-1);
         multi_reason = "jumping around";
index ca558c7e68cdec534e77a3577b0f1ef18052ed3c..bfec1303bb9573f1f87b5238c7b89121cabc5a6b 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 dothrow.c       $NHDT-Date: 1446975465 2015/11/08 09:37:45 $  $NHDT-Branch: master $:$NHDT-Revision: 1.113 $ */
+/* NetHack 3.6 dothrow.c       $NHDT-Date: 1455140444 2016/02/10 21:40:44 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.118 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -615,6 +615,17 @@ int x, y;
         }
     }
 
+    /* Caller has already determined that dragging the ball is allowed */
+    if (Punished && uball->where == OBJ_FLOOR) {
+        int bc_control;
+        xchar ballx, bally, chainx, chainy;
+        boolean cause_delay;
+
+        if (drag_ball(x, y, &bc_control, &ballx, &bally, &chainx,
+                      &chainy, &cause_delay, TRUE))
+            move_bc(0, bc_control, ballx, bally, chainx, chainy);
+    }
+
     ox = u.ux;
     oy = u.uy;
     u_on_newpos(x, y); /* set u.<ux,uy>, u.usteed-><mx,my>; cliparound(); */
index 43e97da63424c40488a06683beccb8a70b410f42..1c9b388724498043f1e34720372964cc8bae61a7 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 teleport.c      $NHDT-Date: 1446887535 2015/11/07 09:12:15 $  $NHDT-Branch: master $:$NHDT-Revision: 1.62 $ */
+/* NetHack 3.6 teleport.c      $NHDT-Date: 1455140444 2016/02/10 21:40:44 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.66 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -252,7 +252,7 @@ boolean allow_drag;
         /* unearth it */
         buried_ball_to_punishment();
     }
-    ball_active = (Punished && uball->where != OBJ_FREE),
+    ball_active = (Punished && uball->where != OBJ_FREE);
     ball_still_in_range = FALSE;
 
     /* If they have to move the ball, then drag if allow_drag is true;