]> granicus.if.org Git - nethack/commitdiff
fix #4189 - burning glob of green slime
authorPatR <rankin@nethack.org>
Wed, 27 Jan 2016 02:32:17 +0000 (18:32 -0800)
committerPatR <rankin@nethack.org>
Wed, 27 Jan 2016 02:32:17 +0000 (18:32 -0800)
When destroy_item() or destroy_mitem() burned up a glob of green slime,
they had the message index and damage amount reversed.  This could give
a nonsense message ("the glob of green slime freezes and shatters") or
go out of array bounds and wreak havoc.  Even if the message index had
been correct, fatal damage would have produced an incorrect cause of
death since it would have used a potion or scroll string.

Now globs will boil and explode like potions, and damage will be
proportional to the size (weight) of the glob, which seems to be the
original intent.

doc/fixes36.1
src/zap.c

index 08440ba5bdde85fec6e58295532cc1cc0b66b83c..cc51218e23b6d611c9553235b6ea61093866b440 100644 (file)
@@ -126,6 +126,7 @@ corpses obtained from tipping an ice box wouldn't rot away
 suppress "you climb up the stairs" message if verbose option is off
 physical damage from mind flayer attack was being inflicted twice
 adjust pending movement points when polymorphing into a slower creature
+damage inflicted by burning glob of green slime gave wrong messages
 
 
 Platform- and/or Interface-Specific Fixes
index 31d6c233178f383c647340444a02815718e95278..38d797e5af399aea7447c66277ac263e1fd65cca 100644 (file)
--- a/src/zap.c
+++ b/src/zap.c
@@ -4630,8 +4630,8 @@ register int osym, dmgtyp;
                 break;
             case FOOD_CLASS:
                 if (obj->otyp == GLOB_OF_GREEN_SLIME) {
-                    dindx = obj->owt / 20;
-                    dmg = 1;
+                    dindx = 1; /* boil and explode */
+                    dmg = (obj->owt + 19) / 20;
                 } else {
                     skip++;
                 }
@@ -4708,6 +4708,8 @@ register int osym, dmgtyp;
                     const char *how = destroy_strings[dindx][2];
                     boolean one = (cnt == 1L);
 
+                    if (dmgtyp == AD_FIRE && osym == FOOD_CLASS)
+                        how = "exploding glob of slime";
                     if (physical_damage)
                         dmg = Maybe_Half_Phys(dmg);
                     losehp(dmg, one ? how : (const char *) makeplural(how),
@@ -4779,8 +4781,8 @@ int osym, dmgtyp;
                 break;
             case FOOD_CLASS:
                 if (obj->otyp == GLOB_OF_GREEN_SLIME) {
-                    dindx = obj->owt / 20;
-                    tmp++;
+                    dindx = 1; /* boil and explode */
+                    tmp += (obj->owt + 19) / 20;
                 } else {
                     skip++;
                 }