Add object sanity check for was_dropped/was_thrown

This commit is contained in:
Michael Meyer
2023-11-17 08:45:55 -05:00
committed by PatR
parent e2e89cb93e
commit c07d114644

View File

@@ -2863,6 +2863,10 @@ objlist_sanity(struct obj *objlist, int wheretype, const char *mesg)
for (obj = objlist; obj; obj = obj->nobj) {
if (obj->where != wheretype)
insane_object(obj, ofmt0, mesg, (struct monst *) 0);
if (obj->was_thrown && obj->was_dropped) {
insane_object(obj, "%s obj is both thrown and dropped! %s %s: %s",
mesg, obj->ocarry);
}
if (Has_contents(obj)) {
if (wheretype == OBJ_ONBILL)
/* containers on shop bill should always be empty */