Files
nethack/doc
PatR 061c2ab1b1 fix #K4098 - lava burns up item being stolen
Three months ago to prevent an "object lost" panic situation when
stealing an item that let hero survive water (several candidates)
would result in drowning, remove_worn_item() was changed to flag the
item being removed as in_use and emergency_disrobe() was changed to
avoid dropping in_use items while drowning.  That seemed to work ok.
But for lava instead of water, in_use is a flag to destroy the item
(set in advance, before issuing messages that can give the player a
chance to trigger a hangup save).  So instead of keeping the item
around for theft to finish, it was deallocating it.  steal() would
format the freed object and then access some of its fields, leading
to havoc.

This adds a hack to allow one item already flagged as in_use to be
treated differently by lava_effects() from the ones it flags for
destruction.  This also seems to work ok, but we may need to start
putting freed items on a deferred deallocation list similar to how
dead monsters are kept around for the rest of the current move.

The fix/hack has revealed two more bugs that this doesn't address.
An item being stolen is removed without any message, then if that
removal doesn't kill the hero a theft message is given.  The message
sequencing is wrong.  Flying hero who loses amulet of flying just
gets affected by lava; player is only told why after life saving.

The other issue is that life-saving from lava can teleport the hero
to where the thief can no longer be seen, yielding "It steals <item>"
even though "It" was visible when the theft started.
2024-02-04 15:40:00 -08:00
..
2022-06-18 10:29:15 -04:00
2023-02-27 10:18:14 -05:00
2023-08-28 16:17:41 -04:00
2022-01-29 22:57:22 -05:00
2022-01-29 22:57:22 -05:00
2022-01-29 22:57:22 -05:00
2024-01-29 10:56:16 -05:00
2024-01-29 10:56:16 -05:00
2024-01-29 10:56:16 -05:00
2024-01-19 17:59:43 +02:00
2018-11-11 10:29:52 -05:00
2018-11-11 10:29:52 -05:00
2022-02-22 20:14:44 -05:00
2023-08-28 16:17:41 -04:00
2018-09-20 18:02:48 -04:00
2024-01-29 08:40:05 -05:00