]> granicus.if.org Git - nethack/commit
stale vptrs for obj->{nexthere,ocontainer,ocarry}
authorPatR <rankin@nethack.org>
Mon, 7 Jan 2019 04:59:20 +0000 (20:59 -0800)
committerPatR <rankin@nethack.org>
Mon, 7 Jan 2019 04:59:20 +0000 (20:59 -0800)
commitd1deafab05995bdedeaf877afd7667fb40eeac3a
treebd9396cd1b38473b12b25c37f28c2fcc675a9362
parenta1fd4622f20fececfa4b8af94c032509fe890f56
stale vptrs for obj->{nexthere,ocontainer,ocarry}

'struct obj' contains a union of mutually exclusive pointers, but
removing an obj from a list wasn't clearing whichever one had been
in use.  If something is removed from a monster's inventory, clear
the object's pointer back to that monster; if something is removed
from a container, clear the object's pointer back to that container;
and whenever something is removed from the floor, clear the pointer
to the object which followed it at that floor location.
src/mkobj.c