From: PatR Date: Wed, 27 Jan 2016 02:32:17 +0000 (-0800) Subject: fix #4189 - burning glob of green slime X-Git-Tag: NetHack-3.6.1_RC01~980 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9085dc2d7ebdff66bac73a26a2920ca0e31ade80;p=nethack fix #4189 - burning glob of green slime 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. --- diff --git a/doc/fixes36.1 b/doc/fixes36.1 index 08440ba5b..cc51218e2 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -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 diff --git a/src/zap.c b/src/zap.c index 31d6c2331..38d797e5a 100644 --- 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++; }