From: PatR Date: Thu, 19 Aug 2021 21:55:22 +0000 (-0700) Subject: delobj() rejection X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3736f2ba4cd3d3e8739a3114cdeb06200ad8a813;p=nethack delobj() rejection If the Amulet or an invocation item refuses to be deleted, make sure the retained object doesn't get left with its in_use bit set. I'm not sure whether there are any cases where this matters. --- diff --git a/src/invent.c b/src/invent.c index 7e223c5e4..14b222fe9 100644 --- a/src/invent.c +++ b/src/invent.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 invent.c $NHDT-Date: 1629408035 2021/08/19 21:20:35 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.338 $ */ +/* NetHack 3.7 invent.c $NHDT-Date: 1629409876 2021/08/19 21:51:16 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.339 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Derek S. Ray, 2015. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1168,6 +1168,7 @@ freeinv(struct obj *obj) update_inventory(); } +/* drawbridge is destroying all objects at */ void delallobj(int x, int y) { @@ -1199,6 +1200,7 @@ delobj(struct obj *obj) * are indestructible via drawbridges, and exploding * chests, and golem creation, and ... */ + obj->in_use = 0; /* in case caller has set this to 1 */ return; } update_map = (obj->where == OBJ_FLOOR);