]> granicus.if.org Git - nethack/commitdiff
riding a non-swimming steed into water
authorcohrs <cohrs>
Wed, 16 Jan 2002 07:05:43 +0000 (07:05 +0000)
committercohrs <cohrs>
Wed, 16 Jan 2002 07:05:43 +0000 (07:05 +0000)
Patch from <Someone> to the list on 10/01/2001.  The changes cause riding a steed
into water to result in a dismount, and, if the steed can't survive in
water, the death of the steed, with the usual pet-death penalties.

doc/fixes33.2
src/hack.c
src/steed.c

index 3ba2047085b2b1e248952bd1ecfc863b01a0e520..009884d6605a9d480e670f3fb75e8779e7d20ecb 100644 (file)
@@ -385,6 +385,7 @@ messages consistent for all monster spells
 monsters casting spells at your displaced image now set mspec_used
 monsters without ranged spells don't print curse messages for ranged spells
 going down to floor using > should set Heart of Ahriman invocation timeout
+riding a steed into water kills the steed if it cannot swim, with penalties
 
 
 Platform- and/or Interface-Specific Fixes
index 61d3ad5f68b86529bee1515ea85888e7aefcc13d..a996207aa06fe681ba678e218b85d97eb46ff1c6 100644 (file)
@@ -1348,8 +1348,21 @@ stillinwater:;
            /* limit recursive calls through teleds() */
            if(is_lava(u.ux,u.uy) && lava_effects())
                    return;
-           if(is_pool(u.ux,u.uy) && !Wwalking && drown())
+           if (is_pool(u.ux, u.uy)) {
+#ifdef STEED
+               if (u.usteed && !is_flyer(u.usteed->data) &&
+                       !is_floater(u.usteed->data) &&
+                       !is_clinger(u.usteed->data)) {
+                   dismount_steed(Underwater ?
+                           DISMOUNT_FELL : DISMOUNT_GENERIC);
+                   /* dismount_steed() -> float_down() -> pickup() */
+                   if (!Is_airlevel(&u.uz) && !Is_waterlevel(&u.uz))
+                       pick = FALSE;
+               } else
+#endif
+               if (!Wwalking && drown())
                    return;
+           }
        }
        check_special_room(FALSE);
 #ifdef SINKS
index 1dc98d6f6b2e3ae9cdd3aae337f2d8d6546b2297..d1b1f1f392189b830dfd3079f3b4013239c5c469 100644 (file)
@@ -552,15 +552,19 @@ dismount_steed(reason)
             * able to walk onto a square with a hole, and autopickup before
             * falling into the hole).
             */
-               /* Keep steed here, move the player to cc; teleds() clears u.utrap */
-               in_steed_dismounting = TRUE;
-               teleds(cc.x, cc.y);
-               in_steed_dismounting = FALSE;
-
-               /* Put your steed in your trap */
-               if (save_utrap)
-                   (void) mintrap(mtmp);
-
+               /* [ALI] No need to move the player if the steed died. */
+               if (!DEADMONSTER(mtmp)) {
+                   /* Keep steed here, move the player to cc;
+                    * teleds() clears u.utrap
+                    */
+                   in_steed_dismounting = TRUE;
+                   teleds(cc.x, cc.y);
+                   in_steed_dismounting = FALSE;
+
+                   /* Put your steed in your trap */
+                   if (save_utrap)
+                       (void) mintrap(mtmp);
+               }
            /* Couldn't... try placing the steed */
            } else if (enexto(&cc, u.ux, u.uy, mtmp->data)) {
                /* Keep player here, move the steed to cc */
@@ -574,7 +578,9 @@ dismount_steed(reason)
        }
 
        /* Return the player to the floor */
+       in_steed_dismounting = TRUE;
        (void) float_down(0L, W_SADDLE);
+       in_steed_dismounting = FALSE;
        flags.botl = 1;
        if (reason != DISMOUNT_ENGULFED) {
                (void)encumber_msg();