]> granicus.if.org Git - nethack/commitdiff
flesh golem healing
authorPatR <rankin@nethack.org>
Tue, 6 Oct 2015 01:32:40 +0000 (18:32 -0700)
committerPatR <rankin@nethack.org>
Tue, 6 Oct 2015 01:32:40 +0000 (18:32 -0700)
Fix one of the entries in the "A few bugs" mail.  Flesh golems hit by
electric damage calculated a healing amount of dam/6, then ignored it
and used dam instead.  Probably never noticed in actual play....

src/mon.c

index fd3e16455ad750a221a116407954664fc8c41797..f257e7f3175e33b0012005c834b1e581a60f3e62 100644 (file)
--- a/src/mon.c
+++ b/src/mon.c
@@ -1,4 +1,4 @@
-/* NetHack 3.6 mon.c   $NHDT-Date: 1438505682 2015/08/02 08:54:42 $  $NHDT-Branch: master $:$NHDT-Revision: 1.182 $ */
+/* NetHack 3.6 mon.c   $NHDT-Date: 1444095155 2015/10/06 01:32:35 $  $NHDT-Branch: master $:$NHDT-Revision: 1.183 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -3357,7 +3357,7 @@ int damtype, dam;
 
     if (mon->data == &mons[PM_FLESH_GOLEM]) {
         if (damtype == AD_ELEC)
-            heal = dam / 6;
+            heal = (dam + 5) / 6;
         else if (damtype == AD_FIRE || damtype == AD_COLD)
             slow = 1;
     } else if (mon->data == &mons[PM_IRON_GOLEM]) {
@@ -3374,7 +3374,7 @@ int damtype, dam;
     }
     if (heal) {
         if (mon->mhp < mon->mhpmax) {
-            mon->mhp += dam;
+            mon->mhp += heal;
             if (mon->mhp > mon->mhpmax)
                 mon->mhp = mon->mhpmax;
             if (cansee(mon->mx, mon->my))