fix #K4026 - "object lost" panic during theft
"object lost" panic occurred when hero's worn amulet of magical breathing was stolen. This prevents drown() -> emergency_disrobe() from dropping an item while in the midst of it being stolen, avoiding the possibility of it no longer being in inventory when the theft completes. There may be variations other than drowning that lead to unwear -> drop-or-destroy that are still vulnerable, and this fix can potentially cause items to vanish from hangup save files. It also has a side-effect of not being able to drop levitation boots to lighten encumbrance enough to crawl out of water if the drowning occurs while they are being taken off, not just when being stolen, even though they should be easily droppable in such circumstance. The hero will just need to drop other things instead.
This commit is contained in:
@@ -4634,14 +4634,16 @@ emergency_disrobe(boolean *lostsome)
|
||||
* Undroppables are: body armor, boots, gloves,
|
||||
* amulets, and rings because of the time and effort
|
||||
* in removing them + loadstone and other cursed stuff
|
||||
* for obvious reasons.
|
||||
* for obvious reasons. Also, any item in the midst
|
||||
* of being taken off or stolen.
|
||||
*/
|
||||
if (!((obj->otyp == LOADSTONE && obj->cursed) || obj == uamul
|
||||
|| obj == uleft || obj == uright || obj == ublindf
|
||||
|| obj == uarm || obj == uarmc || obj == uarmg
|
||||
|| obj == uarmf || obj == uarmu
|
||||
|| (obj->cursed && (obj == uarmh || obj == uarms))
|
||||
|| welded(obj)))
|
||||
|| welded(obj)
|
||||
|| obj->o_id == gs.stealoid || obj->in_use))
|
||||
otmp = obj;
|
||||
/* reached the mark and found some stuff to drop? */
|
||||
if (--i < 0 && otmp)
|
||||
|
||||
Reference in New Issue
Block a user