From: nethack.rankin Date: Sat, 27 May 2006 01:58:22 +0000 (+0000) Subject: fix #H108 - lost protection X-Git-Tag: MOVE2GIT~1001 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a58f2c59ebf93ee18514138a036f3bd3b28c7ec5;p=nethack fix #H108 - lost protection Fix the problem From a bug report, where giving a temple donation of the appropriate amount would fail to restore protection previously stolen by gremlin attack iff the old protection amount was big enough that the donation wouldn't have yielded a bonus in the normal not-stolen case. It shouldn't be checking the magnitude of u.ublessed at a time when lack of the intrinsic renders that value inoperative. After this fix, the lost intrinsic will be granted and the old protection value will be restored, same as happens when a prayer boon yields divine protection (where no u.ublessed magnitude check is made) and as happened with donations when the old protection was a more modest amount (magnitude test passed). --- diff --git a/doc/fixes34.4 b/doc/fixes34.4 index b1a2c3e29..80ad4a52f 100644 --- a/doc/fixes34.4 +++ b/doc/fixes34.4 @@ -229,6 +229,8 @@ when "of " is intentionally being suppressed, an aligned or high specifying role and/or race along with an invalid alignment for it/them in NETHACKOPTIONS or config file would yield a prompt which misleadingly mentioned the rejected alignment when asking player to pick alignment +temple donation can recover protection previously stolen by attrcurse attack + even when protection amount is so big that no increment would be given Platform- and/or Interface-Specific Fixes diff --git a/src/priest.c b/src/priest.c index cb9021c28..1ebec98cd 100644 --- a/src/priest.c +++ b/src/priest.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)priest.c 3.5 2006/01/03 */ +/* SCCS Id: @(#)priest.c 3.5 2006/05/26 */ /* Copyright (c) Izchak Miller, Steve Linhart, 1989. */ /* NetHack may be freely redistributed. See license for details. */ @@ -582,8 +582,13 @@ register struct monst *priest; incr_itimeout(&HClairvoyant, rn1(500,500)); } } else if(offer < (u.ulevel * 600) && - u.ublessed < 20 && - (u.ublessed < 9 || !rn2(u.ublessed))) { + /* u.ublessed is only active when Protection is + enabled via something other than worn gear + (theft by gremlin clears the intrinsic but not + its former magnitude, making it recoverable) */ + (!(HProtection & INTRINSIC) || + (u.ublessed < 20 && + (u.ublessed < 9 || !rn2(u.ublessed))))) { verbalize("Thy devotion has been rewarded."); if (!(HProtection & INTRINSIC)) { HProtection |= FROMOUTSIDE;