From: Pasi Kallinen Date: Thu, 28 Sep 2017 19:38:04 +0000 (+0300) Subject: Give feedback when released from a bear trap X-Git-Tag: NetHack-3.6.1_RC01~333 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1027eacbcad68a7a402ac732a06429c1c4809125;p=nethack Give feedback when released from a bear trap --- diff --git a/doc/fixes36.1 b/doc/fixes36.1 index a31001731..dcfa8eec0 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -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 diff --git a/src/hack.c b/src/hack.c index 11ff4275f..14e7258b4 100644 --- a/src/hack.c +++ b/src/hack.c @@ -1161,7 +1161,7 @@ trapmove(x, y, desttrap) int x, y; /* targetted destination, */ struct trap *desttrap; /* nonnull if another trap at */ { - 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 */ /* [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 */ 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");