]> granicus.if.org Git - nethack/commitdiff
more engraving with empty wands (#Q85)
authornethack.rankin <nethack.rankin>
Sun, 4 Feb 2007 04:01:33 +0000 (04:01 +0000)
committernethack.rankin <nethack.rankin>
Sun, 4 Feb 2007 04:01:33 +0000 (04:01 +0000)
     #Q85: Bug: wrest a wand in one turn through engraving
From a bug report:  engraving with an empty wand while not levitating, then using
ESC to abort when asked for the text to write, let you attempt to wrest
the last charge without using up a turn.  Between the time this report was
sent and received, someone else reported similar issue with levitation,
where no prompting occurs.  The fix for it also fixed the original problem.
Somewhat inadvertently though, since you can now no longer write in the
dust with a empty wand.  I'm going to leave it this way; all that's needed
is some feedback about failing to engrave.

doc/fixes34.4
src/engrave.c

index c81ea39519fa3d21d4bfe010ca56e760748c5c25..eeb2d228625e6ec08e82af7a031fb95d98e7cfd4 100644 (file)
@@ -297,8 +297,7 @@ can't throw if poly'd into form which lacks hands
 can't eat an artifact you're unable to touch
 attempting to kick beyond map edge performed an out of array bounds memory
        access; symptom seen was "show_glyph: bad pos" warning when blind
-attempting to engrave with an empty wand should use a turn even when hero is
-       levitating--trying and failing to wrest a charge takes time
+attempting to engrave with an empty wand should always use a turn
 don't access freed memory after engraving "wrests one last charnge" from wand
 
 
index a02320ca1bb064a9845c75339a9d3b7583322a3b..cbfd5280a824b53f0acb5dbfef7d921774db5acd 100644 (file)
@@ -774,8 +774,14 @@ doengrave()
                } else { /* end if zappable */
                    /* failing to wrest one last charge takes time */
                    ptext = FALSE;      /* use "early exit" below, return 1 */
-                   /* cancelled wand turns to dust unless hero can't write */
-                   if (otmp->spe < 0 && can_reach_floor(TRUE)) zapwand = TRUE;
+                   /* give feedback here if we won't be getting the
+                     "can't reach floor" message below */
+                   if (can_reach_floor(TRUE)) {
+                       /* cancelled wand turns to dust */
+                       if (otmp->spe < 0) zapwand = TRUE;
+                       /* empty wand just doesn't write */
+                       else pline_The("wand is too worn out to engrave.");
+                   }
                }
                break;