diff --git a/src/invent.c b/src/invent.c index 4c9468366..6f2cc2528 100644 --- a/src/invent.c +++ b/src/invent.c @@ -1373,6 +1373,11 @@ freeinv_core(struct obj *obj) } else if (obj->otyp == FIGURINE && obj->timed) { (void) stop_timer(FIG_TRANSFORM, obj_to_any(obj)); } + + if (obj == svc.context.tin.tin) { + svc.context.tin.tin = (struct obj *) 0; + svc.context.tin.o_id = 0; + } } /* remove an object from the hero's inventory */ diff --git a/src/mkobj.c b/src/mkobj.c index 1ec69aa7d..e6d55fcf3 100644 --- a/src/mkobj.c +++ b/src/mkobj.c @@ -2711,6 +2711,10 @@ dealloc_obj(struct obj *obj) gt.thrownobj = 0; if (obj == gk.kickedobj) gk.kickedobj = 0; + if (obj == svc.context.tin.tin) { + svc.context.tin.tin = (struct obj *) 0; + svc.context.tin.o_id = 0; + } /* if obj came from the most recent splitobj(), it's no longer eligible for unsplitobj(); perform inline clear_splitobjs() */