]> granicus.if.org Git - nethack/commitdiff
Wand of digging in a shop crash
authorcohrs <cohrs>
Sat, 16 Nov 2002 05:31:23 +0000 (05:31 +0000)
committercohrs <cohrs>
Sat, 16 Nov 2002 05:31:23 +0000 (05:31 +0000)
From a bug report.  I haven't looked closely, but I think this bug is just
in the development code.  If you dig in a shop with a wand while carrying
unpaid stuff, the shopkeeper would grab your pack, including the wand but
w/o clearing current_wand.  It seems the right thing is to just not grab
the current_wand, since it's not in your pack while you're zapping it.
In 3.4.0, you lost the wand too.

src/shk.c

index 7974e75ed870f09897c86665a137845c6c4cbd25..0c506c11c55dc5f7f3a489d107478f9cae83999d 100644 (file)
--- a/src/shk.c
+++ b/src/shk.c
@@ -3377,6 +3377,7 @@ register int fall;
                if ((obj->owornmask & ~(W_SWAPWEP|W_QUIVER)) != 0 ||
                        (obj == uswapwep && u.twoweap) ||
                        (obj->otyp == LEASH && obj->leashmon)) continue;
+               if (obj == current_wand) continue;
                setnotworn(obj);
                freeinv(obj);
                subfrombill(obj, shkp);