Add object sanity check for was_dropped/was_thrown

This commit is contained in:
Michael Meyer
2023-12-08 15:19:05 -08:00
committed by PatR
parent e2e89cb93e
commit c07d114644
+4
View File
@@ -2863,6 +2863,10 @@ objlist_sanity(struct obj *objlist, int wheretype, const char *mesg)
for (obj = objlist; obj; obj = obj->nobj) { for (obj = objlist; obj; obj = obj->nobj) {
if (obj->where != wheretype) if (obj->where != wheretype)
insane_object(obj, ofmt0, mesg, (struct monst *) 0); 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 (Has_contents(obj)) {
if (wheretype == OBJ_ONBILL) if (wheretype == OBJ_ONBILL)
/* containers on shop bill should always be empty */ /* containers on shop bill should always be empty */