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

@@ -2578,6 +2578,7 @@ E int FDECL(dowrite, (struct obj *));
/* ### zap.c ### */
E void FDECL(learnwand, (struct obj *));
E int FDECL(bhitm, (struct monst *,struct obj *));
E void FDECL(probe_monster, (struct monst *));
E boolean FDECL(get_obj_location, (struct obj *,xchar *,xchar *,int));