From 505f6246b5814df473e9942d33de4e6a4f13680a Mon Sep 17 00:00:00 2001 From: PatR Date: Sun, 3 May 2015 16:54:53 -0700 Subject: [PATCH] fix "deleting worn object" impossibility Migrating objects overload obj->owornmask with a destination code, so rot_corpse needs to clear that before deleting corpses. (Buried objects don't touch owornmask, so rot_organic, which does the actual object deletion, shouldn't need any similar change.) The corpses with owornmask 3 that have been observed recently were slated to arrive on the up stairs, so presumeably fell down the down stairs of the current level and rotted before the hero went down. Put plainly, it was the [post-3.4.3] impossible() check which was in error, not the active game data. --- src/dig.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/dig.c b/src/dig.c index 9f031f1c5..d356668b2 100644 --- a/src/dig.c +++ b/src/dig.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 dig.c $NHDT-Date: 1426465434 2015/03/16 00:23:54 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.73 $ */ +/* NetHack 3.5 dig.c $NHDT-Date: 1430697288 2015/05/03 23:54:48 $ $NHDT-Branch: master $:$NHDT-Revision: 1.86 $ */ /* NetHack 3.5 dig.c $Date: 2012/02/16 03:01:37 $ $Revision: 1.67 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1862,6 +1862,10 @@ long timeout; /* unused */ setmnotwielded(obj->ocarry,obj); MON_NOWEP(obj->ocarry); } + } else if (obj->where == OBJ_MIGRATING) { + /* clear destination flag so that obfree()'s check for + freeing a worn object doesn't get a false hit */ + obj->owornmask = 0L; } rot_organic(arg, timeout); if (on_floor) {