]> granicus.if.org Git - nethack/commitdiff
SF patch 414711: stethoscope fix
authorcohrs <cohrs>
Mon, 30 Jun 2003 01:54:23 +0000 (01:54 +0000)
committercohrs <cohrs>
Mon, 30 Jun 2003 01:54:23 +0000 (01:54 +0000)
Incorporate the submitted stethoscope fix.

doc/fixes34.2
src/apply.c

index 5b41a91adb01a710e30888c5b7468788daf3b8b1..cc9c78f824d27cc859fd419f2243e38335d7cb9a 100644 (file)
@@ -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
index 7288961a84905bb57070738d6c000907a2125bc2..2aebb6cbed0a63ccc973d32f4bec45926d56c187 100644 (file)
@@ -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);