fix github issue #1291 - water walking vs lava

Issue reported by ars3niy:  non-fireproof water walking boots are
supposed to be destroyed if worn on lava, but a post-3.6 change
made that only happen if the hero died and left bones.

The boots remained intact if hero was fire resistant or survived
6d6 damage.  Staying intact should only happen if they're fireproof.

This seems to work but each time lava_effects() gets modified it
becomes more fragile.  Having deleted objects stick around doesn't
help with this problem, which is to keep an item which is being
stolen--and whose loss causes the hero to drop into lava--from
being burned up before being transferred to the thief's inventory.

Fixes #1291
This commit is contained in:
PatR
2024-09-26 08:10:26 -07:00
parent 63294536f6
commit 0dad60e485
3 changed files with 8 additions and 16 deletions

View File

@@ -6650,13 +6650,15 @@ lava_effects(void)
* (3.7: that assumption is no longer true, but having boots be the first
* thing to come into contact with lava makes sense.)
*/
if (uarmf && uarmf->in_use) {
if (uarmf && (uarmf->in_use
|| (is_organic(uarmf) && !uarmf->oerodeproof))) {
obj = uarmf;
pline("%s into flame!", Yobjnam2(obj, "burst"));
++burnmesgcount;
iflags.in_lava_effects++; /* (see above) */
(void) Boots_off();
useup(obj);
if (obj->o_id != protect_oid)
useup(obj);
iflags.in_lava_effects--;
++burncount;
}