From 847e3358c770e5d744acdd5d19bbba55bb88ad49 Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Thu, 10 Feb 2005 04:25:29 +0000 Subject: [PATCH] ring theft 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 | 1 + src/steal.c | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/doc/fixes34.4 b/doc/fixes34.4 index 8e10929d0..ba9ef3bdc 100644 --- a/doc/fixes34.4 +++ b/doc/fixes34.4 @@ -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 diff --git a/src/steal.c b/src/steal.c index ba6886a5d..c94c9af8b 100644 --- a/src/steal.c +++ b/src/steal.c @@ -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" };