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.
This commit is contained in:
@@ -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
|
||||
|
||||
10
src/zap.c
10
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++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user