]> granicus.if.org Git - nethack/commitdiff
steed/leash bit
authornethack.rankin <nethack.rankin>
Mon, 11 Mar 2002 06:41:47 +0000 (06:41 +0000)
committernethack.rankin <nethack.rankin>
Mon, 11 Mar 2002 06:41:47 +0000 (06:41 +0000)
     It's possible to leashed a saddled pet and them ride it,
but it wasn't possible to remove the leash while mounted.  This
fixes that; it also lets you put the leash on your steed while
mounted, but there's nothing wrong with that.

src/apply.c

index 780f8c9b239d93ee91512eef0f506b702e10065f..50f9ddf19ff2c7e5703711428d514b265cc64eb2 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)apply.c    3.4     2002/02/07      */
+/*     SCCS Id: @(#)apply.c    3.4     2002/03/09      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -406,6 +406,13 @@ struct obj *obj;
        y = u.uy + u.dy;
 
        if((x == u.ux) && (y == u.uy)) {
+#ifdef STEED
+               if (u.usteed && u.dz > 0) {
+                   mtmp = u.usteed;
+                   spotmon = 1;
+                   goto got_target;
+               }
+#endif
                pline("Leash yourself?  Very funny...");
                return;
        }
@@ -416,6 +423,9 @@ struct obj *obj;
        }
 
        spotmon = canspotmon(mtmp);
+#ifdef STEED
+ got_target:
+#endif
 
        if(!mtmp->mtame) {
            if(!spotmon)