Fix: NH003 Problem: The replace_object() function does not work if the object is either in a container or being carried by a monster. As far as I can see this is purely a theoritical problem in vanilla NetHack, but becomes a show-stopper in SlashEM where it causes the infamous crash when objects un-polymorph. Compatible with: NetHack 3.3.0 SlashEM 0.0.6E0 Author: J. Ali Harlow, ali@avrc.city.ac.uk Date: 21 Feb 2000 *** ../nethack-3.3.0/src/zap.c Sat Dec 11 05:20:57 1999 --- ./src/zap.c Mon Feb 21 18:24:22 2000 *************** *** 1027,1037 **** break; case OBJ_CONTAINED: otmp->nobj = obj->nobj; obj->nobj = otmp; ! extract_nobj(obj, &obj->ocontainer); break; case OBJ_MINVENT: otmp->nobj = obj->nobj; obj->nobj = otmp; extract_nobj(obj, &obj->ocarry->minvent); break; --- 1027,1039 ---- break; case OBJ_CONTAINED: otmp->nobj = obj->nobj; + otmp->ocontainer = obj->ocontainer; obj->nobj = otmp; ! extract_nobj(obj, &obj->ocontainer->cobj); break; case OBJ_MINVENT: otmp->nobj = obj->nobj; + otmp->ocarry = obj->ocarry; obj->nobj = otmp; extract_nobj(obj, &obj->ocarry->minvent); break;