]> granicus.if.org Git - nethack/commitdiff
polymorph dropping in-use wielded leash part 2
authorcohrs <cohrs>
Mon, 12 Feb 2007 21:40:16 +0000 (21:40 +0000)
committercohrs <cohrs>
Mon, 12 Feb 2007 21:40:16 +0000 (21:40 +0000)
forgot to handle the twoweapon case, and messed up the test logic (which
appeared to work in previous, incomplete testing)

src/polyself.c

index 62d2f950a60bc05b9997823ba8474e8007b9e12e..7327cd70be5ba2098ba3e07030bbc0564a9d30cf 100644 (file)
@@ -737,11 +737,12 @@ int alone;
            otmp2 = u.twoweap ? uswapwep : 0;
            uwepgone();
            if ((!wep->cursed || wep->otyp != LOADSTONE) &&
-               (wep->otyp != LEASH && wep->leashmon != 0))
+               (wep->otyp != LEASH || wep->leashmon == 0))
                dropx(otmp);
            if (otmp2 != 0) {
                uswapwepgone();
-               if (!otmp2->cursed || otmp2->otyp != LOADSTONE)
+               if ((!otmp2->cursed || otmp2->otyp != LOADSTONE) &&
+                   (otmp2->otyp != LEASH || otmp2->leashmon == 0))
                    dropx(otmp2);
            }
            untwoweapon();