]> granicus.if.org Git - nethack/commitdiff
spells doing negative damage
authorcohrs <cohrs>
Mon, 21 Jan 2002 03:41:21 +0000 (03:41 +0000)
committercohrs <cohrs>
Mon, 21 Jan 2002 03:41:21 +0000 (03:41 +0000)
Add a check to zhitm to ensure that spells cast by characters with low XL
and Int will not do negative damage.

doc/fixes33.2
src/zap.c

index 0ac6fc3d5617d119cea947df49fd998bdbd89793..de7f1932499de6a78c46f315d918110690df2d18 100644 (file)
@@ -399,6 +399,7 @@ monsters shouldn't use wands of digging in Sokoban
 objects dropped in or travelling across java pools can take damage
 monsters that enter lava can take damage
 eating an unpaid tin should calculate cost before not after eating
+spells shouldn't do negative damage
 
 
 Platform- and/or Interface-Specific Fixes
index 10cb25ee6c2e8c5a6467463824ff846e9fe4f408..a19d81c8b734239e00d99d30884b89a1b5768c5d 100644 (file)
--- a/src/zap.c
+++ b/src/zap.c
@@ -2981,6 +2981,7 @@ struct obj **ootmp;       /* to return worn armor for caller to disintegrate */
        if (tmp > 0 && type >= 0 &&
                resist(mon, type < ZT_SPELL(0) ? WAND_CLASS : '\0', 0, NOTELL))
            tmp /= 2;
+       if (tmp < 0) tmp = 0;           /* don't allow negative damage */
 #ifdef WIZ_PATCH_DEBUG
        pline("zapped monster hp = %d (= %d - %d)", mon->mhp-tmp,mon->mhp,tmp);
 #endif