]> granicus.if.org Git - nethack/commitdiff
commit 8a13a4d2044264cf7427ba6a035021949788b5f1
authorPatR <rankin@nethack.org>
Sun, 13 Dec 2015 14:15:54 +0000 (06:15 -0800)
committerPatR <rankin@nethack.org>
Sun, 13 Dec 2015 14:15:54 +0000 (06:15 -0800)
Author: PatR <rankin@nethack.org>
Date:   Sun Dec 13 06:06:58 2015 -0800

    fix #H4066 - bug eating ring of protection

    Intrinsic protection of 0 (usually from having a gremlin steal divine
    protection, but also possible by eating a +0 ring of protection) does
    not contribute to "magic cancellation", the defense attribute that
    makes some special attacks fail.  That's intended.  Negative intrinsic
    protection (not possible from having divine protection, but turns out
    to be possible from eating negatively enchanted/charged rings of
    protection), did contribute.  That wasn't intended, so stop it.
    (Positive intrinsic protection gives a magic cancellation of 1 if worn
    armor doesn't provide any MC.)

doc/fixes36.1
src/mhitu.c

index efd39ad2ed70f179e81ddd73248d15d6fb710889..e9d8a81bfbec8e32f14dd6e4d04530afc2c1cac2 100644 (file)
@@ -24,6 +24,8 @@ change dipping prompt to not ignore 'called' and 'named' attributes of item
 avoid 'the unlabeled {scroll,spellbook} fades' when blank item is hit by water
 wrong message given when high priest on astral plane rejects being assigned a
        name (got the one for unique monsters instead of the one for priests)
+negative intrinsic protection shouldn't confer MC=1, "you are warded" (not
+       possible from divine protection but is possible from eating rings)
 
 
 Platform- and/or Interface-Specific Fixes
index 2d489a1c297f429edd92339bb535d4230a9d1cdb..998c86be1a285797fe658a5cc2f2d8e113340140 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 mhitu.c $NHDT-Date: 1446854230 2015/11/06 23:57:10 $  $NHDT-Branch: master $:$NHDT-Revision: 1.130 $ */
+/* NetHack 3.6 mhitu.c $NHDT-Date: 1450016149 2015/12/13 14:15:49 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.131 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -827,7 +827,7 @@ struct monst *mon;
     } else if (mc < 1) {
         /* intrinsic Protection is weaker (play balance; obtaining divine
            protection is too easy); it confers minimum mc 1 instead of 0 */
-        if ((is_you && ((HProtection && u.ublessed) || u.uspellprot))
+        if ((is_you && ((HProtection && u.ublessed > 0) || u.uspellprot))
             /* aligned priests and angels have innate intrinsic Protection */
             || (mon->data == &mons[PM_ALIGNED_PRIEST] || is_minion(mon->data)))
             mc = 1;