From 00addd7eea960bcfc132dc7b1d78b914b4909350 Mon Sep 17 00:00:00 2001 From: cohrs Date: Mon, 30 Jun 2003 01:54:23 +0000 Subject: [PATCH] SF patch 414711: stethoscope fix Incorporate the submitted stethoscope fix. --- doc/fixes34.2 | 1 + src/apply.c | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/doc/fixes34.2 b/doc/fixes34.2 index 5b41a91ad..cc9c78f82 100644 --- a/doc/fixes34.2 +++ b/doc/fixes34.2 @@ -95,6 +95,7 @@ when jousting a pudding into a polymorh trap, it was possible to end up with two of the new type of monster don't allow polymorphed player to web over the stairs geographical shopkeeper updates +stethoscope use should be free the first time it's use per player move Platform- and/or Interface-Specific Fixes diff --git a/src/apply.c b/src/apply.c index 7288961a8..2aebb6cbe 100644 --- a/src/apply.c +++ b/src/apply.c @@ -204,7 +204,8 @@ STATIC_OVL int use_stethoscope(obj) register struct obj *obj; { - static long last_used = 0; + static long last_used_move = -1; + static short last_used_movement = 0; struct monst *mtmp; struct rm *lev; int rx, ry, res; @@ -218,8 +219,10 @@ use_stethoscope(obj) } if (!getdir((char *)0)) return 0; - res = (moves + monstermoves == last_used); - last_used = moves + monstermoves; + res = (moves == last_used_move) && + (youmonst.movement == last_used_movement); + last_used_move = moves; + last_used_movement = youmonst.movement; if (u.uswallow && (u.dx || u.dy || u.dz)) { mstatusline(u.ustuck); -- 2.40.0