]> granicus.if.org Git - nethack/commitdiff
fix #Q382 - jumping possible while riding a sleeping pet (trunk only)
authornethack.rankin <nethack.rankin>
Sun, 11 Feb 2007 01:33:26 +0000 (01:33 +0000)
committernethack.rankin <nethack.rankin>
Sun, 11 Feb 2007 01:33:26 +0000 (01:33 +0000)
     From a bug report:  when riding,
#jump command and jumping spell didn't check whether steed is able to move.
This makes #jump command, either magic boots or knight's innate ability,
fail if the steed can't move.  Spell still succeeds; its magic overrides
steed's immobility.  Fix is trunk only since it relies on a function that
isn't in the branch.

     Also, tweak hero movement to avoid an extra function call per move
when not riding.

doc/fixes35.0
src/apply.c
src/hack.c

index 242a4ae23f8717b8881ce98c8157a62bab6ad6cc..71017911359d2916f6dcda22897177fc05b07bab 100644 (file)
@@ -187,6 +187,7 @@ monsters can use ranged attacks over/around boulders, same as hero
 can't drop part of a stack of N weapons welded to hero's hand
 pickup still accepts m as command prefix, but now rejects F,g,G,M,numpad 5
 scatter piles of kicked gold rather than move the entire pile at once
+#jump attempt fails if mounted on sleeping steed; jumping spell still works
 
 
 Platform- and/or Interface-Specific Fixes
index ef080c525f95077e6888fa9b47f29bffc2ba39df..801eaf1e8b41ff0b3dd98c9d29ed9a92ef25cb68 100644 (file)
@@ -1332,6 +1332,12 @@ int magic; /* 0=Physical, otherwise skill level */
        } else if (!magic && !Jumping) {
                You_cant("jump very far.");
                return 0;
+#ifdef STEED
+       /* if steed is immobile, can't do physical jump but can do spell one */
+       } else if (!magic && u.usteed && stucksteed(FALSE)) {
+               /* stucksteed gave "<steed> won't move" message */
+               return 0;
+#endif
        } else if (u.uswallow) {
                if (magic) {
                        You("bounce around a little.");
index 010abee8c0096a4664fb701b7d454a643f7d59f5..bd339e546b2dc837748ab91dc6d5260460d0af8d 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)hack.c     3.5     2006/08/09      */
+/*     SCCS Id: @(#)hack.c     3.5     2007/02/10      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -1221,7 +1221,7 @@ domove()
        }
        /* not attacking an animal, so we try to move */
 #ifdef STEED
-       if ((u.dx || u.dy) && stucksteed(FALSE)) {
+       if ((u.dx || u.dy) && u.usteed && stucksteed(FALSE)) {
                nomul(0);
                return;
        }