discarding migrating objects when entering endgame

Avoid potential impossible "obfree: deleting worn object" warnings
when entering the endgame.

The code to get rid of items migrating to non-endgame levels passes
those items to obfree().  It needs to clear obj->owornmask first
because that's used for migration flags (undelivered orctown loot
has a non-zero value).
This commit is contained in:
PatR
2022-09-03 10:45:24 -07:00
parent f5a9901db1
commit 82aaa289ef
3 changed files with 14 additions and 10 deletions

View File

@@ -886,13 +886,15 @@ discard_migrations(void)
*oprev = otmp->nobj; /* remove otmp from migrating_objs */
otmp->nobj = 0;
otmp->where = OBJ_FREE;
otmp->owornmask = 0L; /* overloaded for destination usage;
* obfree() will complain if nonzero */
obfree(otmp, (struct obj *) 0); /* releases any contents too */
}
}
}
/* return quality of food; the lower the better */
/* fungi will eat even tainted food */
/* returns the quality of an item of food; the lower the better;
fungi and ghouls will eat even tainted food */
int
dogfood(struct monst *mon, struct obj *obj)
{