]> granicus.if.org Git - nethack/commitdiff
ring theft
authornethack.rankin <nethack.rankin>
Thu, 10 Feb 2005 04:25:29 +0000 (04:25 +0000)
committernethack.rankin <nethack.rankin>
Thu, 10 Feb 2005 04:25:29 +0000 (04:25 +0000)
     Prevent monkeys from stealing any ring which the hero can't remove due
to it being stuck inside the grip of a cursed weapon.  Nymphs can still do
so though.  From a bug report.

doc/fixes34.4
src/steal.c

index 8e10929d0ce905b32e2bb4e1cef6e4bec2889086..ba9ef3bdc46de423df91ec0d9fb610ea14ac2b96 100644 (file)
@@ -86,6 +86,7 @@ interrupt current activity during certain stages of petrification or vomiting
 warning about bad food didn't recognize tin of Medusa meat
 eating tainted Medusa corpse caused food poisioning instead of petrification
 avoid potential stale pointer use after magic bag explosion
+monkeys can't steal rings worn under cursed weapon
 
 
 Platform- and/or Interface-Specific Fixes
index ba6886a5def079467f977a72166e36fea3d829dc..c94c9af8baca53ae36beb99bea2a04708888a6bc 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)steal.c    3.5     2004/11/11      */
+/*     SCCS Id: @(#)steal.c    3.5     2005/02/09      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -315,7 +315,11 @@ gotobj:
            else if (otmp == uquiver || (otmp == uswapwep && !u.twoweap))
                ostuck = FALSE; /* not really worn; curse doesn't matter */
            else
-               ostuck = (otmp->cursed && otmp->owornmask);
+               ostuck = ((otmp->cursed && otmp->owornmask) ||
+                         /* nymphs can steal rings from under
+                            cursed weapon but animals can't */
+                         (otmp == uright && welded(uwep)) ||
+                         (otmp == uleft && welded(uwep) && bimanual(uwep)));
 
            if (ostuck || !can_carry(mtmp, otmp)) {
                static const char * const how[] = { "steal","snatch","grab","take" };