]> granicus.if.org Git - nethack/commitdiff
Give feedback when released from a bear trap
authorPasi Kallinen <paxed@alt.org>
Thu, 28 Sep 2017 19:38:04 +0000 (22:38 +0300)
committerPasi Kallinen <paxed@alt.org>
Thu, 28 Sep 2017 19:38:08 +0000 (22:38 +0300)
doc/fixes36.1
src/hack.c

index a31001731dc392897318dcfc0efb75349ff6179e..dcfa8eec0053516f2b3f94125dd5f25e55da34bf 100644 (file)
@@ -452,6 +452,7 @@ when lit candelabrum burned out, persistent inventory window showed that it
        was no longer lit but still showed phantom candles attached
 improve hilite_status, allowing multiple stops per field, and temporarily or
        permanently hilited fields
+give feedback when released from a bear trap
 
 
 Fixes to Post-3.6.0 Problems that Were Exposed Via git Repository
index 11ff4275ffa3c6f13fde3059fced65ed8beec435..14e7258b46715d0ccb9c96935fa78dffc4813ffb 100644 (file)
@@ -1161,7 +1161,7 @@ trapmove(x, y, desttrap)
 int x, y;              /* targetted destination, <u.ux+u.dx,u.uy+u.dy> */
 struct trap *desttrap; /* nonnull if another trap at <x,y> */
 {
-    boolean anchored;
+    boolean anchored = FALSE;
     const char *predicament, *culprit;
     char *steedname = !u.usteed ? (char *) 0 : y_monnam(u.usteed);
 
@@ -1180,6 +1180,8 @@ struct trap *desttrap; /* nonnull if another trap at <x,y> */
         /* [why does diagonal movement give quickest escape?] */
         if ((u.dx && u.dy) || !rn2(5))
             u.utrap--;
+        if (!u.utrap)
+            goto wriggle_free;
         break;
     case TT_PIT:
         if (desttrap && desttrap->tseen
@@ -1271,6 +1273,7 @@ struct trap *desttrap; /* nonnull if another trap at <x,y> */
                     Norep("You are %s %s.", predicament, culprit);
             }
         } else {
+wriggle_free:
             if (u.usteed)
                 pline("%s finally %s free.", upstart(steedname),
                       !anchored ? "lurches" : "wrenches the ball");