engraving with empty wand

From a bug report:  if you
attempted to engrave with an empty wand while levitating, it wouldn't use
a turn unless you successfully wrested an extra charge out of the wand.
So you could always get such charge in a single elapsed turn of game time
if you didn't care about zapping in any particular direction; extremely
useful for wishing.

     Noticed when checking this:  when you did wrest the extra charge,
the engraving code accessed freed memory for the wand after it had been
used up.

     Lastly, wands producing certain effects always become discovered,
even when you don't yet know what they look like.  (This part of the patch
is trunk-only since it utilizes the routine which fixes similar case for
zapping.)
This commit is contained in:
nethack.rankin
2007-01-27 05:50:10 +00:00
parent e2fffafb7c
commit 5b88c67d97
4 changed files with 17 additions and 12 deletions

View File

@@ -19,7 +19,6 @@ extern boolean notonhead; /* for long worms */
/* kludge to use mondied instead of killed */
extern boolean m_using;
STATIC_DCL void FDECL(learnwand, (struct obj *));
STATIC_DCL void FDECL(polyuse, (struct obj *,int,int));
STATIC_DCL void FDECL(create_polymon, (struct obj *,int));
STATIC_DCL boolean FDECL(zap_updown, (struct obj *));
@@ -117,7 +116,7 @@ const char * const flash_types[] = { /* also used in buzzmu(mcastu.c) */
*/
/* wand discovery gets special handling when hero is blinded */
STATIC_OVL void
void
learnwand(obj)
struct obj *obj;
{