]> granicus.if.org Git - nethack/commitdiff
fix steed eating feedback
authornethack.rankin <nethack.rankin>
Sat, 27 Nov 2004 03:06:21 +0000 (03:06 +0000)
committernethack.rankin <nethack.rankin>
Sat, 27 Nov 2004 03:06:21 +0000 (03:06 +0000)
     <Someone> reported that riding a steed into a magic portal can
give "steed is still eating" message, feedback normally used to explain why
you can't go down stairs.  Rather than preventing portals from activating
in that situation, just force the meal to be finished in order to suppress
the message.  Proper fix is probably to prevent all steed movement while
eating, but that would most likely result in no one ever riding again.

doc/fixes34.4
src/dog.c

index b08cd61dae27586f9740cd28e42a37bee5873d87..7032184b560d1085d8ae67309b2784df4af76c4e 100644 (file)
@@ -67,6 +67,7 @@ helmets don't protect against cockatrice eggs thrown straight up
 breaking container contents in a shop didn't always charge for them
 some types of shop theft of a stack of items only charged for a single one
 wizard mode: WIZKIT wish for own quest artifact triggered crash at startup
+avoid "your steed is still eating" message when going through a magic portal
 
 
 Platform- and/or Interface-Specific Fixes
index a6a94d433d9943c36a243f80e30f8c629474095e..d77be238d0b18c475cceba1afca7059f4187942d 100644 (file)
--- a/src/dog.c
+++ b/src/dog.c
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)dog.c      3.4     2004/06/12      */
+/*     SCCS Id: @(#)dog.c      3.4     2004/11/26      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -507,6 +507,19 @@ boolean pets_only; /* true for ascension or final escape */
                /* monster won't follow if it hasn't noticed you yet */
                && !(mtmp->mstrategy & STRAT_WAITFORU)) {
                stay_behind = FALSE;
+#ifdef STEED
+               if (mtmp == u.usteed) {
+                   /* make sure steed is eligible to accompany hero;
+                      start by having mintrap() give a chance to escape
+                      trap normally but if that fails, force the untrap
+                      (note: handle traps first because normal escape
+                      has the potential to set monster->meating) */
+                   if (mtmp->mtrapped && mintrap(mtmp))
+                       mtmp->mtrapped = 0;             /* escape trap */
+                   mtmp->meating = 0;          /* terminate eating */
+                   mdrop_special_objs(mtmp);   /* drop Amulet */
+               } else
+#endif
                if (mtmp->mtame && mtmp->meating) {
                        if (canseemon(mtmp))
                            pline("%s is still eating.", Monnam(mtmp));
@@ -521,9 +534,6 @@ boolean pets_only;  /* true for ascension or final escape */
                            pline("%s is still trapped.", Monnam(mtmp));
                        stay_behind = TRUE;
                }
-#ifdef STEED
-               if (mtmp == u.usteed) stay_behind = FALSE;
-#endif
                if (stay_behind) {
                        if (mtmp->mleashed) {
                                pline("%s leash suddenly comes loose.",
@@ -532,6 +542,14 @@ boolean pets_only; /* true for ascension or final escape */
                                            : "Its");
                                m_unleash(mtmp, FALSE);
                        }
+#ifdef STEED
+                       if (mtmp == u.usteed) {
+                           /* can't happen unless someone makes a change
+                              which scrambles the stay_behind logic above */
+                           impossible("steed left behind?");
+                           dismount_steed(DISMOUNT_GENERIC);
+                       }
+#endif
                        continue;
                }
                if (mtmp->isshk)