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).
This commit is contained in:
nethack.rankin
2006-05-27 01:58:22 +00:00
parent 3d40afff02
commit a58f2c59eb
2 changed files with 10 additions and 3 deletions

View File

@@ -229,6 +229,8 @@ when "of <deity>" 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

View File

@@ -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;